[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)) {

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)



sc-dev mailing list

--- james mccartney   james@xxxxxxxxxxxxxx   <http://www.audiosynth.com>
SuperCollider - a real time synthesis programming language for the PowerMac.