🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.clos
Article #102

Re: Example of boundary case (sort of long)

#102
From: Trent Lange
Date: Wed, 09 Sep 1992 01:53
57 lines
3541 bytes
In article <65489@cup.portal.com> Thomas_E_Morgan@cup.portal.com writes:
>
>>I'd like to try and help, but I don't understand just what it is you are
>>trying to do.  For one thing, I can't understand what you mean by "slot
>>storage for metaclass instances."  If you can say some more about this
>>that would be good.  
>
>Here's an edited dribble of what I was trying in May '90; the things to notice
>are that my employee's names and so forth are being versioned, but so is 
>the fact that employees have sexes, names etc,  at all.  For reasons that
>Trent has pointed out, this doesn't even get off the ground in July 92 PCL,
>and as I asked earlier, I'm not even sure that it should. 
>
>? (defclass versioned-person (versioned-object))
>  ((sex :accessor sex :initarg :sex)
>   (name :accessor name :initarg :name))
>   (age :accessor age :initarg :age)))
>  (:metaclass standard-versioned-class)))
>[...]

The problem that Tom was having in July 92 PCL is that all of his classes
with metaclass standard-versioned-class use a non-standard slot allocation
scheme (that keeps track of his versions as shown in his example).
This in itself is fine, except that his metaclass standard-versioned-class
has itself as a metaclass -- i.e. all of the slots of his class metaobjects
(e.g. versioned-person, an instance of standard-versioned-class) have
a non-standard :allocation themselves.

In other words, his metaclass standard-versioned-class changes the
:allocation of *all* of the class slots (e.g. direct-superclasses,
direct-slots, etc) of his standard-versioned-class class metaobjects
(e.g. versioned-persion) from their standard :instance allocation to his
:versioned allocation.  This also, of course, means that he is implicitly
(hoping) that the built-in CLOS primary reader generic-functions change
correctly for the class (e.g. class-direct-super-classes, class-direct-slots),
since they have to read from his :versioned allocation slots rather
than the expected :instance allocation.

The question is whether this is "legal" in the AMOP.  I see no reason why
it couldn't be done in PCL (PCL's class metaobject readers use standard
readers, so appropriate changes to slot-value-using-class should do the
trick for him).  One would just have to be very careful to get the order
of the class metaobjects slots' initializations done correctly (as I
pointed out in a previous post).

However, changing the internal allocations of the class metaobject slots
like he is doing might not be portable in terms of the AMOP.  The strictures
against defining methods on SHARED-INITIALIZE for class specializers
(p. 196 of the AMOP) might be read that way.  However, it is not clear.
This, I believe, is the basic question.

- Trent Lange

-- 
*************************************************************************
*   UCLA:  The Greatest School in the History of College Basketball.    *
*************************************************************************
Technical Details
Message-ID: <1992Sep9.015303.22416@cs.ucla.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!sun-barr!ames!elroy.jpl.nasa.gov!news.claremont.edu!ucivax!ucla-cs!lanai.cs.ucla.edu!lange
References: <65489@cup.portal.com>

Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.clos
Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!sun-barr!ames!elroy.jpl.nasa.gov!news.claremont.edu!ucivax!ucla-cs!lanai.cs.ucla.edu!lange
From: lange@lanai.cs.ucla.edu (Trent Lange)
Subject: Re: Example of boundary case (sort of long)
Message-ID: <1992Sep9.015303.22416@cs.ucla.edu>
Sender: usenet@cs.ucla.edu (Mr Usenet)
Nntp-Posting-Host: lanai.cs.ucla.edu
Organization: UCLA Artificial Intelligence Laboratory
References: <65489@cup.portal.com>
Date: Wed, 9 Sep 92 01:53:03 GMT
Lines: 57