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

Re: type-for-copy



Doug Hockin wrote:
> 
> Why is there a type-for-copy function but not a type function?
> If there were a type function how would it be different
> than type-for-copy?
> 
> I hope this isn't a total stupid question.
> 
> -- Doug


It is! :-) :-)

But seriously, the function you are looking for is \object-class.
Whay is it not named \object-type ???
Because the already created objects only have a <class> associated with them.
You can only test for membership using instance?(<type>, obj), but this means
calling a function. Also this is not unique, i.e. an object can be member of may
types (think singleton, limited()).

When creating a new instance, the type supplied to make matters. This is why we have
type-for-copy.


Hope this helps,

	Gabor