[Openmcl-devel] LOOP parallel for/as termination eval order issue.
ron at flownet.com
Mon Oct 18 01:40:06 CDT 2010
On Oct 17, 2010, at 11:01 PM, Kaz Kylheku wrote:
> This is a kludge. It should not be necessary to
> manipulate the order of the
> clauses in order to delay a premature
> termination test.
> This seriously violates the whole loop abstraction.
Actually, order-dependence is required by the spec:
220.127.116.11: ... All variables are initialized first, regardless of where the establishing clauses appear in the source. The order of initialization follows the order of these clauses.
(Not that this has any bearing on the matter at hand, I'm just pointing out that the spec explicitly disagrees with you about order-dependence doing violence to the abstraction.)
Personally I think that this is a bug in the spec, and CCL's behavior is defensible, particularly in a case like this:
(for x in list-that-turns-out-to-be-nil for y = (very-expensive-operation-whose-result-is-only-required-in-the-loop-body) ...)
Why don't you just do:
(loop for x in nil
for y = 3 finally (return (or y 3)))
More information about the Openmcl-devel