Christophe Rhodes <[EMAIL PROTECTED]> writes:
> On Sat, 13 Nov 2004, Sam Steingold wrote:
>
>>> * Rahul Jain <[EMAIL PROTECTED]> [2004-11-13 13:11:54 -0500]:
^^^^^^^^^^^^^^ cute :)
>>>
>>> For some structures, you may store open streams to files in their
>>> slots. How is making a load form for that simple? Maybe you want to
>>> have MAKE-LOAD-FORM re-open the file with the same name when the
>>> structure is reloaded or maybe you want it to lookup the name from
>>> some configurable variable. Do you expect MAKE-LOAD-FORM-SAVING-SLOTS
>>> to figure this out by itself?
>>
>> this argument applies equally well to lists and vectors.
>> should lists and vectors be non-externalizable just because they may
>> contain open streams?
>
[...]
> The globally correct semantics cannot be done for lists or vectors.
Exactly. A list or array is just that: a list or array of values. There
should be no funny semantics in externalizing the values within them
because the implementation cannot guess what the programmer's intention
was in using that list or array. However, a structure that contains
various values, possibly including lists and arrays, can allow the
externalization to be customized.
More importantly, this problem is related to the issue of equality
operators. EQUAL doesn't do semantic equality checking for user-defined
types because it's impossible to define in general. (EQUALP is a rather
strange combination of more general equality generalizations that I
don't see as having any relationship to each other, so I can't accept it
as a reasonable equality predicate without knowing the types of the
operands beforehand.)
MAKE-LOAD-FORM allows you to (indirectly) specify semantic equality for
your types in the context of re-creating the given object in a different
lisp session. Arguably, a structure that uses the default copier should
have a similar default externalizer defined for it, but I don't see the
big gain in adding this to the spec, as structures are already rather
semantically muddled for hysterical raisins and don't really deserve
extra effort for the sake of completeness.
--
Rahul Jain
[EMAIL PROTECTED]
Professional Software Developer, Amateur Quantum Mechanicist