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

Re: "is a" relationships

The other way to get inheritance of structure in Self
is to _Define your prototypes as copies of the ones you want to extend:

... addSlotsIfAbsent ...

traits animal _Define: ( |
	p* = traits clonable.
	animal behavior
| )

animal _Define: ( |
	p* = traits animal.
	animal data slots
| )

traits mammal _Define: ( |
	p* = traits animal.
	mammal behavior
| )

mammal _Define: animal copy _AddSlots: ( |
	p* = traits mammal.
	mammal data slots
| )

Note the "animal copy _AddSlots:" this does the copy down when you read in
the file.