Compile, then load the attached file.
Then compile and load a file containing the single form
(moretest)
The FAS-loader causes struct-slot's initform to be
evaluated, which results in an error, since I want
struct-slot to always be supplied an initial value.
This is a contrived version of a problem encountered
while trying to use CLISP to bootstrap SBCL.
At least CMUCL and SBCL handle this example without an
error. I haven't tried other implementations.
Logged In: NO
Oops! I tried to attach a file, but my browser barfed and
submitted the bug report without the sample file. I'll send
the sample to the mailing list.
Logged In: YES
user_id=5735
(defun required-argument ()
(error "A required argument was not supplied"))
(eval-when (:compile-toplevel :load-toplevel :execute)
(defstruct (struct (:constructor make-struct (slot)))
(slot (required-argument) :type cons)))
(defmethod make-load-form ((obj struct) &optional env)
(declare (ignore env))
(make-load-form-saving-slots obj))
(defun handle-struct (struct)
(format t "~A" (struct-slot struct)))
(defmacro test ()
`(let ()
(let ((var (make-struct (list 10))))
`(progn
(eval-when
(:compile-toplevel :load-toplevel :execute)
(handle-struct ',var))))))
(defmacro moretest()
(test))
Logged In: YES
user_id=5735
I observe identical behavior from CMUCL 18c and CLISP.
please try again.
Logged In: YES
user_id=5735
thank you for your bug report.
the bug has been fixed in the CVS tree.
you can either wait for the next release (recommended)
or check out the current CVS tree (see http://clisp.cons.org\)
and build CLISP from the sources (be advised that between
releases the CVS tree is very unstable and may not even build
on your platform).