chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] Why define-constant is not a constant?


From: Evan Hanson
Subject: Re: [Chicken-users] Why define-constant is not a constant?
Date: Tue, 8 Dec 2015 19:37:01 +1300

Hi Joe,

That's not really what `define-constant` is for. Here, "constant" means
"constant value", not "lexical identifier that can't be changed".

Even so, the compiler does happen to do what you're expecting (as
opposed to the interpreter, where `define-constant` is equivalent to
`define`):

    $ cat foo.scm
    (define-constant test1 "initial value")
    (define test1 "I got changed")
    (print test1)
    $ csc foo.scm
    $ ./foo
    initial value

Cheers,

Evan



reply via email to

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