unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Kenichi Handa <handa@m17n.org>
Cc: emacs-devel@gnu.org
Subject: Re: defconst in lao.el
Date: Wed, 17 Nov 2004 10:41:48 +0900 (JST)	[thread overview]
Message-ID: <200411170141.KAA24828@etlken.m17n.org> (raw)
In-Reply-To: <200411141856.iAEIuEM24284@raven.dms.auburn.edu> (message from Luc Teirlinck on Sun, 14 Nov 2004 12:56:14 -0600 (CST))

In article <200411141856.iAEIuEM24284@raven.dms.auburn.edu>, Luc Teirlinck <teirllm@dms.auburn.edu> writes:
> I believe that all defconst's in lao.el should be
> defvar's.  Several are changed in the file itself and
> produce compiler warnings.  I propose the patch below.  I
> am not sure what to do about the Copyright:

> ;; Copyright (C) 1997 Electrotechnical Laboratory, JAPAN.
> ;; Licensed to the Free Software Foundation.

Please keep it as is and add a new Copyright line below it
(see leim/quail/latin-post.el) if you modify this file.

But...

> ! (defconat lao-key-alist
...
> ! (defvar lao-key-alist

The original defconst doesn't yield a warning, and this
variable is surely not modified later.

> ! (defvar lao-consonant-key-alist nil)
> ! (defvar lao-semivowel-key-alist nil)
> ! (defvar lao-vowel-key-alist nil)
> ! (defvar lao-voweltone-key-alist nil)
> ! (defvar lao-tone-key-alist nil)
> ! (defvar lao-other-key-alist nil)
  
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.

---
Ken'ichi HANDA
handa@m17n.org

  parent reply	other threads:[~2004-11-17  1:41 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 [this message]
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
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=200411170141.KAA24828@etlken.m17n.org \
    --to=handa@m17n.org \
    --cc=emacs-devel@gnu.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).