[chuck-users] determining the type of an Object in code

Kassen signal.automatique at gmail.com
Wed Feb 11 00:25:29 EST 2009


2009/2/11 mike clemow <gelfmuse at gmail.com>

> If getType() was stubbed out, then my guess is that we shouldn't mess
> with it.  Perhaps we should change the name of this method to
> something else.  getClass() maybe...
>

How about ".isA( type)" that would return true or false ?

I'm suggesting that because some object may be
*a Object
*a UGen
*a STKInstrument
*a Sitar

...all at the same time. So; "my_sitar" would return true for all those and
this;

if ( my_sitar.isA( Event ) ) do.someThing();

...wouldn't work.

Does that make sense to you?

Kas.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20090211/c579715a/attachment.htm>


More information about the chuck-users mailing list