[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Implementation of MAP, SOME, EVERY, etc...
Date: Wed, 27 Mar 1985 23:19 EST
From: "Scott E. Fahlman" <Fahlman@CMU-CS-C.ARPA>
The Common Lisp LENGTH function returns NIL when given a circular list.
I disagree. On page 265 of the aluminum edition, we find the following
"LIST-LENGTH differs from LENGTH when the list is circular; LENGTH may
fail to return, whereas LIST-LENGTH will return NIL."
The feeling was that LENGTH was used often, and we didn't want to
require that it run more slowly on all lists just to accommodate the
rare case of a circular list.
My mistake. LENGTH used to check for circular lists, and when that feature
was removed from the language we saw no reason to remove it from our
implementation. I foolishly relied on memory and trying an example,
rather than checking the manual.