Robert;<br><br>&gt; I&#39;ll change your &quot;probably be&quot; to &quot;&quot;: it WOULD be preferable to call the<br>&gt; most specific version of an overloaded function.  ChucK&#39;s class system has<br>&gt; single, straight-line inheritance, so the &quot;most specific&quot; is always well<br>
&gt; defined.<br><br>You are probably ;-) right, I was hesitant to make a strong statement here as I wasn&#39;t sure this would hold true in all cases. There might be exceptions though now that I have thought about it for a while I have to admit I still haven&#39;t found any. I&#39;m hesitant to make strong claims in fields like this because the situation might stretch to near infinite complexity and unforeseen possibilities may pop up.<br>
<br>&gt;  The current scheme -- using the (lexically) first function<br>&gt; definition -- seems fraught with astonishment.<br><br>I don&#39;t think the situation is terrible; it doesn&#39;t crash, correct behaviour can be had and the results seem deterministic so far. It can also be improved without breaking old code in nearly all cases. My main issue is the lack of documentation. The manual just notes;<br>
<br><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote"><b>overloading</b><br>Overloading a function allows functions with the same name to be defined with different arguments.<br>
The function must be written in separate instances to handle the input, and the return type must<br>agree.<br></blockquote><br>...and gives some examples. I&#39;d say it would also be useful to point out exactly what overloading is, because the above will make zero sense to first time programmers, why we would use it and note things like the above.<br>
<br>Generally the order in which functions and classes are defined in the code shouldn&#39;t matter, at least the specs don&#39;t make any mention of this mattering, yet it does. The other cases that I know of are just plain bugs. To me this seems like a case where the passes of the parser over the code don&#39;t exactly reflect what should be done and more should be moved to a preliminary pass that scans for definitions and files them appropriately for dealing with the rest of the code.<br>
<br>&gt;<br>&gt; Thanks for digging into this.<br><br>My pleasure; it was a good puzzle and the result taught us something new.<br><br>Yours,<br>Kas.<br>