[Top][All Lists]

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

Re: Possible defvar bug

From: Didier Verna
Subject: Re: Possible defvar bug
Date: Mon, 18 Feb 2013 16:00:28 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Jambunathan K <address@hidden> wrote:

> I am certain I don't understand what these paragraphs mean,
> particularly the second one.
> lands.

> ,----  C-h f
> | If SYMBOL has a local binding, then this form affects the local
> | binding.  This is usually not what you want.  Thus, if you need to
> | load a file defining variables, with this form or with `defconst' or
> | `defcustom', you should always load that file _outside_ any bindings
> | for these variables.  (`defconst' and `defcustom' behave similarly in
> | this respect.)
> `----

  This means that:

ELISP> (let ((foo 3))
         (defvar foo 1)
         (print foo))
ELISP> foo
*** Eval error ***  Symbol's value as variable is void: foo

And, no, this is almost never what you want :-) Just like Tassilo
noticed by accident.

Resistance is futile. You will be jazzimilated.

Scientific site:   http://www.lrde.epita.fr/~didier
Music (Jazz) site: http://www.didierverna.com

reply via email to

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