That bit of code would be great, if it worked.  What I made did this:<div><br></div><div>if( myUgen.typeOf() == "SinOsc" ) {     // a string is ugly...</div><div>    myUgen $ SinOsc => SinOsc s;</div><meta charset="utf-8"><div>
}<br><br></div><div>However, if the reserved word-- SinOsc --could be made equivalent to what was returned from .typeOf() or .className(), then it would be totally great.</div><div><br></div><div>My hack was trivial, but this one wouldn't be.</div>
<div><br></div><div>Mike</div><div><br><div class="gmail_quote">On Tue, Nov 9, 2010 at 12:13 PM, Michael Heuer <span dir="ltr"><<a href="mailto:heuermh@gmail.com">heuermh@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">mike clemow wrote:<br>
<br>
> Honestly, I've run into this a lot in the past and I'm familiar with this<br>
> frustration.  I even hacked my own version of chuck in which each object<br>
> responded to a .typeOf(); message that returned a string representation (I<br>
> know, it's ugly) of it's class name.  I used this to make do smart casting,<br>
> which I admit is still a huge compromise.  I still think that each class<br>
> name (reserved word) should be able to represent itself.  Something to the<br>
> tune of:<br>
> if( myUgen.typeOf() == SinOsc ) {    // seems reasonable, right?<br>
>     myUgen $ SinOsc => SinOsc s;<br>
> }<br>
<br>
</div>I don't find that ugly, it's a cool hack.  What if the method were<br>
called className()?<br>
<br>
I vote for adding such to the git repo and push to get it added upstream.<br>
<div><div></div><div class="h5"><br>
   michael<br>
_______________________________________________<br>
chuck-users mailing list<br>
<a href="mailto:chuck-users@lists.cs.princeton.edu">chuck-users@lists.cs.princeton.edu</a><br>
<a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users" target="_blank">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><a href="http://michaelclemow.com">http://michaelclemow.com</a><br><a href="http://semiotech.org">http://semiotech.org</a><br><br>
</div>