unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Großjohann)
Cc: Colin Walters <walters@verbum.org>, emacs-devel@gnu.org
Subject: Re: defvar vs setqif..
Date: Mon, 20 May 2002 22:05:19 +0200	[thread overview]
Message-ID: <vafn0uua8lc.fsf@INBOX.auto.emacs.devel.tok.lucy.cs.uni-dortmund.de> (raw)
In-Reply-To: <ap3r8k6d4dr.fsf@poynting.umd.edu> ("D. Goel"'s message of "20 May 2002 15:08:00 -0400")

"D. Goel" <deego@glue.umd.edu> 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?

kai
-- 
Silence is foo!

  parent reply	other threads:[~2002-05-20 20:05 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-19 20:44 defvar vs setqif D. Goel
2002-05-19 20:59 ` Colin Walters
2002-05-20  0:05   ` Miles Bader
2002-05-20 19:08   ` D. Goel
2002-05-20 19:41     ` Thien-Thi Nguyen
2002-05-20 19:47       ` Stefan Monnier
2002-05-21 13:13         ` D. Goel
2002-05-20 20:05     ` Kai Großjohann [this message]
2002-05-20 21:33   ` Richard Stallman
2002-05-20  0:03 ` Miles Bader
2002-05-20 19:00   ` D. Goel
2002-05-20 19:24     ` Stefan Monnier
2002-05-20 19:40       ` D. Goel
2002-05-20 23:15     ` Miles Bader
2002-05-21 13:18       ` D. Goel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=vafn0uua8lc.fsf@INBOX.auto.emacs.devel.tok.lucy.cs.uni-dortmund.de \
    --to=kai.grossjohann@cs.uni-dortmund.de \
    --cc=emacs-devel@gnu.org \
    --cc=walters@verbum.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).