[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Why is Elisp's defvar weird? And is eval_sub broken?
From: |
Daniel Colascione |
Subject: |
Re: Why is Elisp's defvar weird? And is eval_sub broken? |
Date: |
Sun, 15 Feb 2015 06:17:45 -0800 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 |
On 02/14/2015 06:36 AM, Stefan Monnier wrote:
>> A declaration of free dynamic variables for a function could tell the
>> byte compiler that those free variables aren't typos, since
>> otherwise the byte compiler would expect either the symbol to be
>> declared special or a lexical variable by that name to be in scope.
>
> There is such a declaration already. It's called (defvar <foo>). Tada!
>
>>> Normally, such conflicts should never happen
>>> because all special vars should be named with a "package prefix", but
>>> sadly, reality is different, so it was indispensable to make this
>>> effect local, to allow lexical-binding code to work reliably.
>> By using llet, the byte compiler will catch such conflicts, and your code
>> (interpreted or compiled) that uses it will work reliably despite the
>> conflicts. This means defvar's weird behavior is no longer needed.
>
> It's not weird once you understand that it's a compiler directive which
> is absent from the .elc file.
How are users supposed to understand that when it's completely absent
from the documentation?
signature.asc
Description: OpenPGP digital signature
- Why is Elisp's defvar weird? And is eval_sub broken?, Kelly Dean, 2015/02/12
- Re: Why is Elisp's defvar weird? And is eval_sub broken?, Stefan Monnier, 2015/02/13
- Re: Why is Elisp's defvar weird? And is eval_sub broken?, Kelly Dean, 2015/02/14
- Re: Why is Elisp's defvar weird? And is eval_sub broken?, Stefan Monnier, 2015/02/14
- Re: Why is Elisp's defvar weird? And is eval_sub broken?,
Daniel Colascione <=
- Re: Why is Elisp's defvar weird? And is eval_sub broken?, Kelly Dean, 2015/02/16
- Re: Why is Elisp's defvar weird? And is eval_sub broken?, Stefan Monnier, 2015/02/16
- Re: Why is Elisp's defvar weird? And is eval_sub broken?, Kelly Dean, 2015/02/17
- Re: Why is Elisp's defvar weird? And is eval_sub broken?, Stefan Monnier, 2015/02/18
- Re: Why is Elisp's defvar weird? And is eval_sub broken?, Kelly Dean, 2015/02/19
- Re: Why is Elisp's defvar weird? And is eval_sub broken?, Stefan Monnier, 2015/02/19
- Re: Why is Elisp's defvar weird? And is eval_sub broken?, Kelly Dean, 2015/02/19
- Re: Why is Elisp's defvar weird? And is eval_sub broken?, Stefan Monnier, 2015/02/19
- Proposal for a closed-buffer tracker, Kelly Dean, 2015/02/21
- Re: Proposal for a closed-buffer tracker, Eli Zaretskii, 2015/02/22