|  |  | last edited 10 years ago by test1 | 
| 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
u:= [9,2,4,7]; concat! (u, [1,2,42]); end := rest(u,4); part:=rest(u,2); setrest!(end, part);
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