[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Lexical environment for functions?
From: |
David Kastrup |
Subject: |
Re: Lexical environment for functions? |
Date: |
Sun, 28 Dec 2014 07:40:59 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
Stefan Monnier <address@hidden> writes:
>> Does that mean that lexical environments exist only for value cells?
>
> Yes, at least for the "native" lexical binding.
>
>> Because it would seem convenient, if one has some
>> Lisp-like presentation of a parse tree like XML, to just eval it with a
>> number of function bindings in place.
>
> Just like you could simulate the new (eval E ENV) form via
> (eval `(lexical-let ,ENV ,E)), you can do the above with
> (eval `(cl-flet FENV E)).
cl-flet is optimized for compilation rather that interpretation. So
this is not likely to make eval a good idea for fast interpretation of
parsed expressions.
--
David Kastrup