emacs-devel
[Top][All Lists]
Advanced

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

Re: Should lexical-let use let in the situation lexical-binding is t ?


From: Stefan Monnier
Subject: Re: Should lexical-let use let in the situation lexical-binding is t ?
Date: Tue, 18 Sep 2012 20:41:30 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux)

>     As mentioned in my reply there, the two aren't quite compatible (because
>     (lexical-let ((tab-width 4)) foo) will be a lexical binding, whereas
>     (let ((tab-width 4)) foo) will be a dynamic binding)
> Is it really a sensible thing to make a lexical binding for a variable
> that is normally dynamic?

We don't need to answer this question, because the difference between
`let' and `lexical-let' in this respect is more likely to be accidental.

This said, there can be good reasons to force a lexical binding, when
you fear that the code might be run in a context where the variable
might happen to be defvar'd.


        Stefan



reply via email to

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