Subject: Re: Loop for and behaviour
From: rpw3@rpw3.org (Rob Warnock)
Date: Wed, 26 May 2004 18:37:33 -0500
Newsgroups: comp.lang.lisp
Message-ID: <gKKdnVFKJ-egtyjdRVn-uA@speakeasy.net>
Antonio Menezes Leitao  <Antonio.Leitao@evaluator.pt> wrote:
+---------------
| Please, please, hear my pray.  I'm about to sin...If I don't get an
| answer, I will disrespect the 6.1.1.4 commandment.
+---------------

The standard is as it is, nothing can change that at this point.
As long as you don't break any code that conforms with the standard,
you have wide latitude to do as you wish. As it says in CLHS 6.1.1.4:

    ...it is implementation-dependent whether the lexical environment
    in which the initial value forms (variously called the form1,
    form2, form3, step-fun, vector, hash-table, and package) in any
    for-as-subclause, except for-as-equals-then, are evaluated includes
    only the loop variables preceding that form or includes more or all
    of the loop variables;

Conforming programs will never depend on any particular choice that
the implementor made here. But beware:

    [The] form1 and form2 in a for-as-equals-then form includes the
    lexical environment of all the loop variables.

Conforming programs *may* depend on this latter clause, so don't break that.


-Rob

-----
Rob Warnock			<rpw3@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607