SV: redefined constant value

"Pavel Grozman" <[email protected]> Sun, 26 Oct 2003 21:33:13 +0100
Newsgroups gmane.lisp.corman
Message-ID <[email protected]>
This is not an error. According to HyperSpec,

  A constant defined by defconstant can be redefined with defconstant.
  However, the consequences are undefined if an attempt is made to ...
  assign it to a different value using a subsequent defconstant.

Pavel Grozman

> -----Ursprungligt meddelande-----
> Från: Denis Mashkevich [mailto:[email protected]]
> Skickat: den 26 oktober 2003 17:28
> Till: [email protected]
> Ämne: [cormanlisp] redefined constant value
>
>
> Here's the problem:
>
> (defconstant +a+ 22)
> > +A+
>
> (defun foo ()
>     +a+)
> > FOO
>
> (foo)
> > 22
>
> ;redefining the constant:
> (defconstant +a+ 33)
> > ;;; Warning: Redefining constant +A+ with previous value 22 and new
> value 33
> > +A+
>
> (foo)
> > 22
>
>
> ;redefining the function
> (defun foo ()
>      +a+)
> > FOO
>
> (foo)
> > 33
>
>
> BTW, CLISP doesn't exhibit this behaviour.
>
>                  Thanks, Denis.
>
>
>
> To unsubscribe from this group, send an email to:
> [email protected]
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/SyjtlB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
[email protected]

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/