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

Re: "is a" relationships

On Sep 23,  7:43pm, Brad Might wrote:
} This is what I have tried, is it the way to go ? 
} prototypes _AddSlots: (| 
} 	animal = (| 
} 		parent* = traits animal.
} 		"object specific stuff here".
} 		|).
} 	mammal = (|
} 		parent* = traits mammal.
} 		inherit**. "at initialization (copy), this slot will be
} 				filled in with a copy of prototypes animal"

   You are not the only one to ponder exactly how to do this. 
   Particularily nasty is that changing the animal prototype doesn't
affect the inherited slots of mammal at all. Of course, it doesn't
affect any existing animals either. I was hacking on `copy-on-write'
slots at one point, but this as was with 1.1, and one couldn't 
use _AddSlots: from within a method...
   I think that something like that is the solution. 

   :!mcr!:            |  The postmaster never | So much mail, 
   Michael Richardson |    resolves twice.    |  so little time.
HOME: mcr@sandelman.ocunix.on.ca     Bell: (613) 237-5629
SCHOOL: 192228@physics.carleton.ca