Re: LOOP blows!



On Thu, 7 Feb 2008 20:33:58 -0800 (PST), Kaz Kylheku <kkylheku@xxxxxxxxx> wrote:

Try:

(loop for x = '(1 2 3) for y in x collect y)

If that yields NIL, it shows that the broken LOOP isn't propagating
the '(1 2 3) from the first FOR to the second.

My understanding of the LOOP specification is that your expectation is
wrong. Amongst other things, in 6.1.1.8 it explicitly says that the
rules in 3.6 have to be obeyed, specifically the one about list
traversal. If the loop above behaved as you'd expect in a conforming
implementation, how would you expect

(loop for i from 5 downto 2
for x = (loop for j below i collect j)
for y in x
collect y)

to behave? I think the Lisp you're using is broken.

FWIW, LispWorks also returns NIL for your example and that seems to be
right to me.

Edi.

--

European Common Lisp Meeting, Amsterdam, April 19/20, 2008

http://weitz.de/eclm2008/

Real email: (replace (subseq "spamtrap@xxxxxxxxxx" 5) "edi")
.