emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: need for 'dynamical-let'?


From: Dmitri Paduchikh
Subject: Re: need for 'dynamical-let'?
Date: Fri, 24 Jul 2015 21:54:13 +0500
User-agent: Gnus/5.13 (Gnus v5.13)

Stephen Leake <address@hidden> writes:

SL> Can we define a macro 'dynamical-let' that would implement this
SL> pattern, but with hidden variables?

Not sure about pattern with hidden variables, but `dynamical-let' which
would always establish dynamic binding will be useful for writing macros.
Currently, if I understand right, expansion of the macro

(defmacro foo ()
  '(let ((some-variable t))
     (bar)))

is treated differently depending on the current value of `lexical-binding':
the macro will create lexical binding where this variable is t, and dynamic
binding otherwise. This is bad as it can easily introduce unintended
behavior changes to code. `dynamical-let' would provide some control to
macro writers. Natively supported `lexical-let' would be also good to have.
But may be give them somewhat shorter names.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]