help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: The two-argument form of defvar


From: Nicolas Richard
Subject: Re: The two-argument form of defvar
Date: Thu, 19 Mar 2015 16:03:05 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

Philipp Stephani <p.stephani2@gmail.com> writes:

> Hi,
>
> when looking at the source code of defvar it becomes clear that the
> two-argument form
>
> (defvar foo)
>
> is a no-op.

Not always a no-op. The source code has this comment :
    /* A simple (defvar foo) with lexical scoping does "nothing" except
       declare that var to be dynamically scoped *locally* (i.e. within
       the current file or let-block).  */

To reflect the above comment, the docstring has :
| The `defvar' form also declares the variable as "special",
| so that it is always dynamically bound even if `lexical-binding' is t.

-- 
Nicolas Richard



reply via email to

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