[Openmcl-devel] LOOP parallel for/as termination eval order issue.

Stas Boukarev stassats at gmail.com
Sun Oct 17 20:27:43 UTC 2010


Kaz Kylheku <kaz at kylheku.com> writes:

> Hi all,
>
> The following for returns nil in CCL and Allegro, but (1 2 3) in Clisp.
>
> (loop for x in nil and y = '(1 2 3) then (cdr y) finally (return y))
>
> My expectation is that the CLISP behavior is right, because
> X and Y ought to be initialized in parallel to NIL and (1 2 3)
> respectively. Only then should the loop termination test kick in
> due to X having run out of items. The FINALLY clause must not
> see a nil value of Y.
> When major implementations get stuff like this wrong, no wonder
> Lispers eschew LOOP (or include their own LOOP macro in the
> code base).
I find this test-case to be contrived.

-- 
With Best Regards, Stas.



More information about the Openmcl-devel mailing list