Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#853 closed defect (wontfix)

DEFVAR after DEFCONSTANT does not signal an error when no initial value provided

Reported by: rongarret Owned by:
Priority: trivial Milestone:
Component: Compiler Version: trunk
Keywords: Cc:



Welcome to Clozure Common Lisp Version 1.7-dev-r14715M-trunk  (DarwinX8664)!
? (defconstant x 1)
? (defvar x)  ; Should signal an error but doesn't
? (defvar x 1)
> Error: Can't redefine constant X .

Change History (3)

comment:1 Changed 10 years ago by rongarret

  • Priority changed from normal to trivial

comment:2 Changed 10 years ago by rme

  • Resolution set to wontfix
  • Status changed from new to closed

This isn't really a defect, per se: the spec says that the consequences are undefined if an attempt is made to assign a value to the symbol using another operator, or to change its value with a subsequent defconstant.

CCL happens to check constant-ness when the value is set.

Also, I guess that you have ccl:*always-eval-user-defvars* set to t, otherwise defvar would notice that x is already boundp, and wouldn't try to reinitialize it in the (defvar x 1) case.

I believe that the current behavior is reasonable.

Note: See TracTickets for help on using tickets.