> * Christophe Rhodes <[EMAIL PROTECTED]> [2004-11-12 17:24:05 +0000]:
>
> Sam Steingold <[EMAIL PROTECTED]> writes:
>
>> this file works in GCL, CLISP and LW but not in CMUCL:
>> -----
>> (defstruct a b c)
>> (defparameter *foo* #.(make-foo))
>> -----
>>
>> As people have pointed out, ANSI 3.2.4.4 requires a MAKE-LOAD-FORM
>> method for that to work, so I added this:
>>
>> #+cmu
>> (defmethod make-load-form ((self structure-object) &optional environment)
>>   (make-load-form-saving-slots self :environment environment))
>>
>> Then I get a zillion errors:
>
> Sam, I told you why this MAKE-LOAD-FORM method is totally broken in
> Message-ID: <[EMAIL PROTECTED]> sent to cmucl-help around
> 2004-11-09 21:20 UTC.  Did you perhaps miss it?  I didn't Cc you in
> that reply because of your headers
>   Mail-Followup-To: [EMAIL PROTECTED]
>   Mail-Copies-To: never
> but maybe I should have?

I read cmucl-help on gmane.
I do not see your message there.
Do you have a URL handy?
Sorry about the noise.

>> ; In: DEFSTRUCT FOO
>>
>> do I need to redefine defstruct to always define a make-load-form method?!
>
> You need to define a MAKE-LOAD-FORM method on your structure's class,
> to reflect the similarity relationship that you want, rather than
> assuming that MAKE-LOAD-FORM-SAVING-SLOTS does the right thing for all
> possible structure types in the entire system.

structures are supposed to be simple enough :-)

#+cmu (eval-when (compile load eval) (shadow 'defstruct))
#+cmu
(defmacro defstruct (name &rest slots)
  (let ((type (if (consp name) (first name) name)))
    `(progn
       (cl:defstruct ,name ,@slots)
       (defmethod make-load-form ((self ,type) &optional environment)
         (make-load-form-saving-slots self :environment environment)))))


-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.honestreporting.com>
If you think big enough, you'll never have to do it.

Reply via email to