[Top][All Lists]

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

Re: defconst in lao.el

From: Luc Teirlinck
Subject: Re: defconst in lao.el
Date: Wed, 17 Nov 2004 12:35:47 -0600 (CST)

Stefan Monnier wrote:

   The "right" answer is to put the defconst in the body of the let.

I do believe that it is better to put a defconst at top level.
Putting it elsewhere is probably going to give worse problems than
just compiler warnings, anyway.

One can always do that as follows (without compiler warnings):

(defvar temp-my-const temp-value)
;; we need to re-initialize temp-my-const when this file is re-loaded.
(setq temp-my-const temp-value)

... initializing code....

(defconst my-const temp-my-const)

Note that the defvar-setq pair is necessary because, unlike CL, Elisp
has no defparameter.

In the case of lao.el however, I believe that using no defconst's at
all is better, because Handa has indicated that it actually might make
sense for a user to change `lao-key-alist' in his .emacs, in which
case defconst could lead to trouble.



reply via email to

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