[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: lexical-binding questions
From: |
Stefan Monnier |
Subject: |
Re: lexical-binding questions |
Date: |
Tue, 15 May 2012 22:05:36 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) |
>>>> (setq lexical-binding t)
>>>> (let ((nil 0)) nil) => 0
>> Anyway, I guess nil and t should be marked as special-variable-p, if for
>> no other reason than because they are pretty damn special.
> The problem also applies to keyword symbols.
Indeed, except it's a lot less likely that people will try to let-bind
a keyword symbol (it happens to me several times a year to choose `t'
for a variable name, only to find it doesn't work, but I never suffered
from that problem with a keyword symbol).
> I was thinking
> if (!NILP (lexenv) && SYMBOLP (var)
> + && !SYMBOL_CONSTANT_P (var)
> && !XSYMBOL (var)->declared_special
> && NILP (Fmemq (var, Vinternal_interpreter_environment)))
> /* Lexically bind VAR by adding it to the lexenv alist. */
> lexenv = Fcons (Fcons (var, tem), lexenv);
It would be more efficient to set declared_special on keyword symbols.
Stefan
- Re: lexical-binding questions, (continued)
Re: lexical-binding questions, egnarts-ms, 2012/05/13