Robert;<div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
[1] Accessing class name from an object<br>
<br>
I seem to recall seeing a way to get an object to yield its class name, if only for printing.  But I haven&#39;t been able to locate the e-mail thread where that was discussed.  Was I hallucinating?  (I really only want this for debugging, but if it&#39;s a supported function, it may be useful for dispatching on class type.)<br>

<br></blockquote><div><br>Just try to &quot;print the object&quot;, like this;<br><br>Gain foo; //clearly a object<br>&lt;&lt;&lt; foo &gt;&gt;&gt;;<br><br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

[2] initializing an object<br>
<br>
Is there a subclassable method that is called when you instantiate an object?  or do have to instantiate then initialize manually, as in:<br>
<br></blockquote><div><br>Not within ChucK as such, though the code that is in the body of the object itself (and outside of member functions) will run at instantiation, which seems to come down to a solution of your issue?<br>
<br>This is provided we wrote the object ourselves, or extended it from a ready made one. Sadly UGens can&#39;t be extended in a working way.<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

[3] &quot;natural&quot; sorting of objects<br>
<br>
Is there any attribute of an object that you can reliably use as a sort key?  I ask because I want to speed up searching of an array of objects (e.g. to see if an object is already present).  As I understand it, I can&#39;t use a hash array since there are no iterators.<br>

<br></blockquote><div>Not within ChucK right now that I know of.<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I guess the question should be: what&#39;s the fastest way to maintain a *set* of objects (i.e. a collection in which an object may only appear once) with the usual operations for insertion, deletion and iteration?<br>
<br></blockquote><div><br>This sounds tricky, especially for the general case of sets that might include many different types of objects. You could keep them in a &quot;set&quot; by having a array of type Object and appending and assigning to that -I think- but I see no way to remove duplicates as I don&#39;t think the &quot;==&quot; operator covers objects in that general a way. I&#39;m really not sure here.<br>
</div></div><br>Erm.... good questions! ;-)<br>Kas.<br>