#432 List doesn't check for circularity in length
last edited 10 years ago by test1

Edit detail for #432 List doesn't check for circularity in length revision 2 of 6

1 2 3 4 5 6
Editor: Bill Page
Time: 2008年09月01日 12:18:59 GMT-7
Note: fix typo and add ref

changed:
-We should either fix the documentation (saying, that this is the case), or check for circularity. This could be done by calling 'INTEGER-LENGTH' in 'ILIST', for example.
-
We should either fix the documentation (saying, that this is the case), or check for circularity. This could be done by calling 'LIST_-LENGTH' instead of 'LENGTH' in 'ILIST', for example.
According to the common lisp standard list-length returns nil if the
list is circular.
http://www.lispworks.com/documentation/HyperSpec/Body/f_list_l.htm


Submitted by : kratt6 at: 2008年09月01日T12:05:02-07:00 (17 years ago)
Name :
Axiom Version :
Category : Severity : Status :
Optional subject :
Optional comment :

axiom
u:= [9,2,4,7]; concat! (u, [1,2,42]); end := rest(u,4); part:=rest(u,2);
setrest!(end, part);
Type: List PositiveInteger?

Asking for the number of elements of u will exhibit lisp-implementation-dependend behaviour, ranging from an error to an infinite loop.

We should either fix the documentation (saying, that this is the case), or check for circularity. This could be done by calling LIST_-LENGTH instead of LENGTH in ILIST, for example.

According to the common lisp standard list-length returns nil if the list is circular.

http://www.lispworks.com/documentation/HyperSpec/Body/f_list_l.htm

AltStyle によって変換されたページ (->オリジナル) /