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

Re: Issue: LOAD-OBJECTS (Version 2)

This looks good.  The only thing I have doubts about is:

>   The function MAKE-LOAD-FORM-USING-SLOTS can be useful in user-written
>   MAKE-LOAD-FORM methods.  Its first argument is the object.  Its
>   optional second argument is a list of the names of the slots to
>   preserve; it defaults to all of the local slots.
>   MAKE-LOAD-FORM-USING-SLOTS returns forms that construct an equivalent
>   object using MAKE-INSTANCE and SETF of SLOT-VALUE for slots with
>   values, or SLOT-MAKUNBOUND for slots without values, or using other
>   functions of equivalent effect. 

Rather than having the second argument default to a list of all instance
slots, it might be better to consider two separate cases:

  1. If a second argument is supplied, then MAKE-INSTANCE will be used to
     create the object, (using INITIALIZE-INSTANCE to default the slot
     values), and then the designated slots will be forced to
     have the proper value.

  2. Without a second argument, ALLOCATE-INSTANCE will be used to create
     the object (without invoking INITIALIZE-INSTANCE or
     SHARED-INITIALIZE), and then all the slots will be filled in.

If you are going to specify all of the slot values, then there shouldn't
be a need to compute default values, and it may be undesirable to invoke
INITIALIZE-INSTANCE -- for example, it might complain about missing
required arguments or perform undesired side-effects.

>   The default MAKE-LOAD-FORM method for STANDARD-OBJECT signals an
>   error.

Wouldn't it be permissible to just not have a default method, so that a
"no applicable method" error is signalled?