On Mon, Jan 5, 2009 at 2:01 PM, Erik Huelsmann <ehuels@...> wrote:
> On Mon, Jan 5, 2009 at 1:39 PM, Ville Voutilainen
> <ville.voutilainen@...> wrote:
>> On Mon, Jan 5, 2009 at 8:41 AM, Robert Dodier <robert_dodier@...> wrote:
>>> The following code:
>>> (defvar foo '(1 2 3))
>>> (defun f ()
>>> (let ((foo (cdr foo)) (bar (car foo)))
>>> (format t "FOO=~S, BAR=~S~%" foo bar)))
>> If you want something like that to work reliably, you need to use let*. Even the
>> standard makes no guarantees which of the bindings are done first if you
>> do that in let instead of let*.
> True, but with LET, you know they'll be "in parallel", meaning that
> all initforms will see the old bindings; only the LET-body sees the
> new bindings. So, I can see where _let() in SpecialOperators goes
> wrong here, but it's interesting to think what the right way would be
> to do it. Evaluate all initforms and bind after that?
Ville and I just identified the solution in a short IRC conversation.
SpecialOperators.java needs adjusting:
lines 188-190 must be used in the !sequential case (let*), however, in
the sequential case, the symbol and outcome must be cached and bound
at line 196 after the "while (varList != NIL)" loop ends.
Thanks for your report, a fix will probably be committed soon (as in "today").