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

Re: slot types



On Sun, 10 Sep 95 20:48:46 -0500
Jason Jobe <asimov!jason@nextsrv1.andi.org> wrote:
> It seems to me that is starting to sound somewhat like dylan's slot  
> allocation attribute which supports the following options:
> 
> 1. instance - each instance gets one

     ( | x <- 1 | )

> 2. class - one for the specified class, subclasses share it.

     parent _AddSlots: ( | x <- 1 | )

> 3. each-subclass - class gets one as does each subclass (used by  
> direct instances)

We don't have this, but it could be added to the programming
environment - see how "copy-down" slots are done.

> 4. constant - no setter method

    ( | x = 1 | )

> Now these are defined in a "class" oriented environment but it does  
> seem reasonable to specify a "clone" allocation attribute that does  
> the right thing for simple cases. Of course, one can always  
> override the "clone" method to do whatever you want.

Self's syntax already handles most of the "slot types" you mentioned
and a few more. User defined slot types would be things like slots
that would count the number of times the were changed, for example.
This is probably *not* a good idea however - you can get these kind
of effects with the normal slots like in "color" and "rawColor".

-- Jecel