Try .toString(): it's the closest thing.
SinOsc foo;
Object bar;
class MyClass {
float value;
}
MyClass myInstance;
<<
1. Instanceof in ChucK (Will Hardwick-Smith)
From: Will Hardwick-Smith
To: chuck-users@lists.cs.princeton.edu Date: 30 oktober 2014 23:34:57 CET Reply-To: ChucK Users Mailing List Subject: [chuck-users] Instanceof in ChucK Say I have Object o, and I want to see if it is an instance of UGen or a sub-class of UGen. Is there a way to check this in ChucK?
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
Ah sorry Will, I misread your question. I am afraid that there is no built-in way in ChucK to check what is the super-class of an object. However, you could take a look at this earlier discussion which discusses the same problem: https://lists.cs.princeton.edu/pipermail/chuck-users/2013-January/007223.htm... best, Casper
On 31 okt. 2014, at 17:09, Casper Schipper
wrote: Try .toString(): it's the closest thing.
SinOsc foo; Object bar;
class MyClass { float value; }
MyClass myInstance;
<<
>>; << >>; << >>; "SinOsc:10061d9a0" : (string) "Object:61000009e190" : (string) "MyClass:61000009e140" : (string)
Best, Casper
1. Instanceof in ChucK (Will Hardwick-Smith)
From: Will Hardwick-Smith
mailto:whardwicksmith@gmail.com> To: chuck-users@lists.cs.princeton.edu mailto:chuck-users@lists.cs.princeton.edu Date: 30 oktober 2014 23:34:57 CET Reply-To: ChucK Users Mailing List mailto:chuck-users@lists.cs.princeton.edu> Subject: [chuck-users] Instanceof in ChucK Say I have Object o, and I want to see if it is an instance of UGen or a sub-class of UGen. Is there a way to check this in ChucK?
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu mailto:chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
participants (1)
-
Casper Schipper