[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Possible defvar bug
From: |
Tassilo Horn |
Subject: |
Re: Possible defvar bug |
Date: |
Mon, 18 Feb 2013 16:42:57 +0100 |
User-agent: |
Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (gnu/linux) |
Alan Mackenzie <address@hidden> writes:
>> ELISP> (let ((foo 3))
>> (defvar foo 1)
>> (print foo))
>> 3
>> ELISP> foo
>> *** Eval error *** Symbol's value as variable is void: foo
>> ELISP>
>
>> And, no, this is almost never what you want :-) Just like Tassilo
>> noticed by accident.
>
> Why would anybody want to defvar a variable inside a let binding which
> also defines it, anyway?
Yes, these minimal examples look weired. The real code was a bit more
like
(let* ((crm-separator ",") ...)
...
(function-that-might-read-multiple-values-using-crm))
and `function-that-might-read-multiple-values-using-crm' dispatches if
one or multiple separated values are to be read, and then delegates to a
read-single-value or read-multiple-values-with-crm function. The latter
required crm when being called.
The let-binding of `crm-separator' was just meant as a default value in
case crm was going to be used, because all LaTeX keyval-options use ","
to separate key-value pairs.
Bye,
Tassilo
- Possible defvar bug, Tassilo Horn, 2013/02/18
- Re: Possible defvar bug, Jambunathan K, 2013/02/18
- Re: Possible defvar bug, Tassilo Horn, 2013/02/18
- Re: Possible defvar bug, Didier Verna, 2013/02/18
- Re: Possible defvar bug, Alan Mackenzie, 2013/02/18
- Re: Possible defvar bug, Thierry Volpiatto, 2013/02/18
- RE: Possible defvar bug, Drew Adams, 2013/02/18
- Re: Possible defvar bug, Thierry Volpiatto, 2013/02/18
- RE: Possible defvar bug, Drew Adams, 2013/02/18
- Re: Possible defvar bug, Lawrence Mitchell, 2013/02/18
- Re: Possible defvar bug,
Tassilo Horn <=
- Re: Possible defvar bug, Didier Verna, 2013/02/18
Re: Possible defvar bug, Glenn Morris, 2013/02/18
- Re: Possible defvar bug, Richard Stallman, 2013/02/19
- Re: Possible defvar bug, Stefan Monnier, 2013/02/19
- Re: Possible defvar bug, Richard Stallman, 2013/02/19
- Re: Possible defvar bug, Stefan Monnier, 2013/02/19
- Re: Possible defvar bug, Tassilo Horn, 2013/02/20
- Re: Possible defvar bug, Stefan Monnier, 2013/02/20
- Re: Possible defvar bug, Richard Stallman, 2013/02/20