[Top][All Lists]

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

Re: defvar vs setqif..

From: Kai Großjohann
Subject: Re: defvar vs setqif..
Date: Mon, 20 May 2002 22:05:19 +0200
User-agent: Gnus/5.090007 (Oort Gnus v0.07) Emacs/21.2.50 (i686-pc-linux-gnu)

"D. Goel" <address@hidden> writes:

> say a user wants to frob a thousand variables in their .emacs or their
> own private library...  they don't want to (require) all the involved
> libraries, thus slowing down the loading of emacs.. so the user simply
> make sures the variables are defined via defvar, and then runs
> (add-to-list) or whatever on these variables..

IMHO, this is a bad idea.  The intention of add-to-list is to add
something to whatever the value was before, right?  And before the
add-to-list, the most meaningful value would be the default value
(instead of nil).

Now, if a variable has a non-nil default value, then your suggestion
means it will have a very short value: just the single item you put
in it.  So

    (defvar foo)
    (add-to-list 'foo 'item)

could as well have been written 

    (setq foo '(item))

Now, most lists should have nil default values, to facilitate
Customize.  But your argument strikes me as a bad argument: to add
something to the default value, users will have to require the
corresponding *.el file anyway.

Or am I misunderstanding something here and way too tired?

Silence is foo!

reply via email to

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