Re: structure constructor in defconstant
"k r" <[email protected]>
| Newsgroups | gmane.lisp.cmucl.general |
|---|---|
| Message-ID | <[email protected]> |
Works. Thanks all, Keith On 10/28/07, Harald Hanche-Olsen <[email protected]> wrote: > + "k r" <[email protected]>: > > > (defstruct (point (:conc-name nil)) > > x y z) > > (defconstant eye (make-point :x 0 :y 0 :z 200)) > > [...] > > ; Compiling: /home/keithr/rt4.lisp 28 OCT 07 01:38:34 pm > > > > ; Byte Compiling Top-Level Form: > > ; Converted MAKE-POINT. > > ; Compiling DEFSTRUCT POINT: > > > > Error in KERNEL:%COERCE-TO-FUNCTION: the function MAKE-POINT is undefined. > > [Condition of type UNDEFINED-FUNCTION] > > You probably need to wrap the defstruct in an EVAL-WHEN form: > > (eval-when (:compile-toplevel :load-toplevel :execute) > (defstruct ...)) > > Likely, the defconstant will cause other troubles if you try to > recompile and/or reload the file, but that's a topic for another day. > > - Harald >