FYI: we've had this conversation before...<div><br></div><div><a href="https://lists.cs.princeton.edu/pipermail/chuck-dev/2006-March/000135.html">https://lists.cs.princeton.edu/pipermail/chuck-dev/2006-March/000135.html</a></div>
<div><br></div><div>Graham Coleman actually implemented this at one point using an instanceof keyword, like in Java.</div><div><br></div><div>-Mike</div><div><br></div><div><br><br><div class="gmail_quote">2010/11/9 Kassen <span dir="ltr"><<a href="mailto:signal.automatique@gmail.com">signal.automatique@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br><br><div class="gmail_quote"><div class="im">On 9 November 2010 18:46, Michael Heuer <span dir="ltr"><<a href="mailto:heuermh@gmail.com" target="_blank">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">
Right, that's why I proposed className().<br></blockquote><div><br></div></div><div>Check.</div><div class="im"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>
A real instanceof keyword would return true for all of<br>
<br>
(myUgen instanceof SinOsc.class)<br>
(myUgen instanceof UGen.class)<br>
(myUgen instanceof Object.class)<br>
<br></blockquote><div><br></div></div><div>I'm a bit lost about this notation. Is this in the C++ stuff? I'd be happy with "my_ugen.instanceOf( SinOsc )" returning true or false as well. This would probably make code smaller and it would make debug printing slightly more complicated, though we can simply print the object and get a (useless) memory address and it's type.</div>
<div class="im">
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
which would help with Kas' use case.  How about<br>
<br>
fun String className()<br>
fun String[] classNames()<br><br></blockquote><div><br></div></div><div>where ".classname()" would be equivalent to ".classNames()[ .classnames().cap() - 1 ]", assuming we go from the most general to the most specific right? I'm not sure about that order yet. It will depend on whether we'd mostly be happy with some general info and would go into the details more rarely or whether we would tend to try something specific, then go up the tree until we encounter something that would hold. I suspect the first case to be more common. That's a bit of a detail though.</div>

<div><br></div><div>Yours,</div><div>Kas.</div></div>
<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>
<br></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>