list | list or cyclic list |
LIST-LENGTH function computes length of the lists. LIST-LENGTH will return NIL if it encounters cyclic cons cell structure. LIST-LENGTH is slower than LENGTH because of additional cycle checking.
(list-length '(a . (b . nil))) => 2 (list-length '#1=(a . (b . #1#))) => NIL
(list-length (list 'a 'b 'c)) => 3 (list-length nil) => 0 (list-length (cons "moo" nil)) => 1 (list-length (cons "moo" (cons "boo" nil))) => 2