SANO Masatoshi <snmsts@...> writes:
> attached is a patch to stop looping when nthcdr or elt find NIL as the end
> of a list.
> The difference can be seen if you evaluate these function with big index
> (nth 10000000 '())
> (elt '() 10000000)
ELT should be signalling an error in this case.
> I'm not sure about the cost of null check,but other implementations seems to
> check it.
I'm not convinced either that it's worth it to check for NIL, since I
expect most cases to be within the list or slightly larger than the
list, where this won't matter.
With best regards, Stas.