[chuck-users] Intraspection - an example of what I'm attempting

Kassen signal.automatique at gmail.com
Mon Nov 8 14:44:10 EST 2010


> I'm not sure that's true. I just tried this:
You are right. I doubted for a moment because of the array and how arrays
tend to muck with the type system but this fails too;

JCRev foo;

.1 => ((foo $ UGen) $ Chorus).mix;

> The "mix" method won't have a common location in the vtable. You might
> get lucky casting a JCRev to a PitShift since "mix" is the first
> method for both of them, but I certainly wouldn't count on that to
> always work.
Indeed! Turns out we just got lucky a lot of times. It does work for the
STKInstruments and the convenience filters. I seem to remember you can also
have it work for anything that has a .freq() but maybe there too we just got
lucky so far.

That's a bit disappointing; it was a nice trick while it lasted. I suppose
it still is for those places where you can get away with it. I think I
talked about this before, but I'd like any object to have a .type() that
would return a array like this; ["Object", "UGen", "Filter, "LPF"]. The VM
has all of that data, we just can't get to it.

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

More information about the chuck-users mailing list