Just out of curiosity I looked at the eval implementation for GNU
Emacs (eval.c file), and noticed that the implementation of let* seems
more efficient that the implementation of let. The later involves
allocating a temporary array to hold the values from evaluating the
forms before binding them to the variables.
I'm wondering if this is true in all LISP implementations?
I don't think the speed difference between let and let* very big, so
it doesn't really matter, but I'm just curious :-)
Thanks,
Alex.
Hello!
Alexandru Harsanyi <········@mac.com> wrote:
>Just out of curiosity I looked at the eval implementation for GNU
>Emacs (eval.c file), and noticed that the implementation of let* seems
>more efficient that the implementation of let. The later involves
>allocating a temporary array to hold the values from evaluating the
>forms before binding them to the variables.
>I'm wondering if this is true in all LISP implementations?
>I don't think the speed difference between let and let* very big, so
>it doesn't really matter, but I'm just curious :-)
In a compiler, the speed difference should be none. Except that you
could get littler freedom for instruction scheduling, if in a let*
later bindings refer to earlier ones.
That's speaking about lexical lets at least.
Kind regards,
Hannah.