[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [sc-dev] primitives: divine class of slot
There is isKindOfSlot for when you have a slot and you don't know what
it holds (maybe not an object pointer).
inline bool isKindOfSlot(PyrSlot *slot, struct PyrClass *testclass)
Every object has a field called classptr. See PyrObject.h
struct PyrObjectHdr {
struct PyrObjectHdr *prev, *next;
struct PyrClass *classptr;
...
If you have a slot and you want a class pointer from it you can use
inline struct PyrClass* classOfSlot(PyrSlot *slot)
On Monday, December 9, 2002, at 06:47 PM, crucial felix wrote:
this is wrong:
if(isKindOf(b,class_identdict)) {
printf("dict\n");
}
how do i easily fetch a PyrClass pointer to "Dictionary" ?
what's the best method to use to check class ? ( i want isKindOf :
subclasses included)
thanks.
-felix
_______________________________________________
sc-dev mailing list
sc-dev@xxxxxxxxxxxxxxx
http://www.create.ucsb.edu/mailman/listinfo/sc-dev
--
--- james mccartney james@xxxxxxxxxxxxxx <http://www.audiosynth.com>
SuperCollider - a real time synthesis programming language for the
PowerMac.
<ftp://www.audiosynth.com/pub/updates/SC2.2.16.sea.hqx>