GNU bug report logs -
#67116
byte-compile-let: reversing the order of evaluation of the clauses CAN make a difference.
Previous Next
Reported by: Alan Mackenzie <acm <at> muc.de>
Date: Sat, 11 Nov 2023 22:50:01 UTC
Severity: normal
Done: Mattias EngdegÄrd <mattias.engdegard <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
Message #26 received at 67116 <at> debbugs.gnu.org (full text, mbox):
>> Sounds like a bug.
> It does? I always thought that the order of evaluation in a let form
> is unspecified,
I'm not sure if we say so explicitly somewhere, but ELisp's order of
evaluation is very much always "left to right" and that carries over to
`let`.
> Why on Earth should we require any particular order of evaluation in
> a let form??
That's a popular bikeshedding subject, actually.
On one side you have the proponents of leaving the order unspecified
(like in C and Scheme) on the premise that it allows more choice for the
compiler, on the other you have the proponents of specifying the order
so as to remove an ugly corner case that bites programmers.
I am personally not swayed by the optimization argument (tho the OCaml
bytecode compiler had a good argument in favor of right-to-left
evaluation order) and in the case of ELisp, there's a lot of code out
there which already relies on the current evaluation order.
Stefan
This bug report was last modified 1 year and 245 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.