[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: defvar without value
From: |
Drew Adams |
Subject: |
RE: defvar without value |
Date: |
Tue, 31 Mar 2020 17:36:36 -0700 (PDT) |
> Using `defvar' (on top-level) without specifying a value differs in two
> ways from calls that specify a value: (1) the variable's value is not
> set, and (2) the variable is made special only in the context of the
> (rest of the) current file or buffer.
>
> I wonder if it is good that these two things are chained together, and
> if there are alternatives to what we have now. Latest changes have
> revealed that in some cases, people wanted (1) to always get compiler
> warnings when a variable is not explicitly bound, but they didn't
> intend
> that the variable is not always special. Dunno to how many people this
> happened, but it is a kind of pitfall.
I've thought the same thing. I don't see a logical connection. If that's
right then linking them is a bit ugly.
For one thing, it seems wrong that the only way to proclaim that a variable is
to special globally is to give it a defvar default value.