From: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: teirllm@dms.auburn.edu, emacs-devel@gnu.org
Subject: Re: defconst in lao.el
Date: Wed, 17 Nov 2004 09:17:49 -0500 [thread overview]
Message-ID: <jwvvfc41s0h.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <200411170141.KAA24828@etlken.m17n.org> (Kenichi Handa's message of "Wed, 17 Nov 2004 10:41:48 +0900 (JST)")
> I used "defconst" for them because they have to be set back
> to nil when lao.el is re-loaded. They are setup in the
> following (let ...) form to correct values. If we change
> them to "defvar", they are anyway set to nil in that (let
> ...) form. And, conceptually, they are "constant". So I
> think "defconst" is better.
> Then, how to avoid the compiler warnings? The problem is
> that their initial values are calculated at the same time
> (not one by one) in the "let" form.
The "right" answer is to put the defconst in the body of the let.
Of course if you do that, you get complaints from the byte-compiler because
it doesn't see those defconst as being at the top-level and thus doesn't
relize that they are *always* defined.
We should fix this in the byte-compiler but nobody's done it yet.
But you can work around those warnings by adding a couple (defvar foo)
before the let. Ugly, tho.
Stefan
next prev parent reply other threads:[~2004-11-17 14:17 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-14 18:56 defconst in lao.el Luc Teirlinck
2004-11-14 21:06 ` Stefan Monnier
2004-11-14 21:47 ` Luc Teirlinck
2004-11-15 14:00 ` Richard Stallman
2004-11-17 1:41 ` Kenichi Handa
2004-11-17 3:01 ` Luc Teirlinck
2004-11-17 6:39 ` Stephan Stahl
2004-11-17 14:26 ` Luc Teirlinck
2004-11-17 22:05 ` Luc Teirlinck
2004-11-17 3:07 ` Luc Teirlinck
2004-11-17 3:57 ` Luc Teirlinck
2004-11-17 14:17 ` Stefan Monnier [this message]
2004-11-17 18:35 ` Luc Teirlinck
2004-11-17 19:03 ` Stefan Monnier
2004-12-04 2:49 ` Kenichi Handa
2004-12-04 3:43 ` Luc Teirlinck
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=jwvvfc41s0h.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=emacs-devel@gnu.org \
--cc=teirllm@dms.auburn.edu \
/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).