Newsgroups: comp.lang.lisp
Path: cantaloupe.srv.cs.cmu.edu!rochester!cornellcs!newsfeed.cit.cornell.edu!newsstand.cit.cornell.edu!travelers.mail.cornell.edu!news.kei.com!news.mathworks.com!newsfeed.internetmci.com!news.sprintlink.net!EU.net!news2.EUnet.fr!news.fnet.fr!ilog!news
From: haible@laplace.ilog (Bruno Haible)
Subject: Re: Getting rid of 'warning' in Clisp
In-Reply-To: dikui205@diku.dk's message of 13 Oct 1995 07:13:57 GMT
Message-ID: <HAIBLE.95Oct26203552@laplace.ilog>
Lines: 29
Sender: news@ilog.fr
Nntp-Posting-Host: laplace
Bcc: haible
Cc: <dikui205@diku.dk>
Organization: ILOG S.A., Gentilly, France
References: <45l3jl$dbv@odin.diku.dk>
Date: 26 Oct 1995 19:35:52 GMT


Martin Koch <dikui205@diku.dk> writes:

   If a constant c (defconstant c foo) is redefinded in clisp, it prints
   a warning message like...

If you define a constant, in Common Lisp the compiler may assume that
it won't change (i.e. that its value will remain EQL over its lifetime).
If you redefine a constant, you are therefore playing dangerous games
with the compiler.

   Is there any way of turning the 'warning' feature off?

Use DEFPARAMETER instead of DEFCONSTANT. Or, if you want to emphasize
in your source that the parameter's value won't change, use some macro
like

(defmacro DEF-CONSTANT-PARAMETER (name &rest more)
  `(DEFPARAMETER ,name ,@more)
)


----------------------------------------------------------------------------
Bruno Haible                            net: <haible@ilog.fr>
ILOG S.A.                               tel: +33 1 4908 3585
9, rue de Verdun - BP 85                fax: +33 1 4908 3510
94253 Gentilly Cedex                    url: http://www.ilog.fr/
France                                  url: http://www.ilog.com/

