Aha... I agree that&#39;s a bit weird. Perhaps lines like these:<div><br></div><div>y =&gt; int z;</div><div><br></div><div>are seen as an initialization of z, where y can be taken from the outer scope, and not treated the same as</div>
<div><br></div><div>int z;</div><div>y=&gt; z;</div><div><br></div><div>/Stefan<br><br><div class="gmail_quote">On Wed, Apr 22, 2009 at 10:19 PM, Hans Aberg <span dir="ltr">&lt;<a href="mailto:haberg@math.su.se">haberg@math.su.se</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">On 22 Apr 2009, at 21:01, Stefan Blixt wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Compilers can&#39;t always be expected to understand every kind of error, and that error message isn&#39;t the worst I&#39;ve seen :) Still, if the opportunity os there to change it to something better, now harm done. The situation can be translated to this:<br>

<br>
int x;<br>
1 =&gt; x[1];<br>
<br>
which gives the same subscript error message. Hans&#39;s code is otherwise without problems - ChucK allows (like many other languages) to reuse a variable identifier in a new block, so x can be redeclared as an int in the inner while loop, overshadowing the outer x which is an array.<br>

</blockquote>
<br></div>
The problem is really that &#39;chuck&#39; accepts<div class="im"><br>
   x[msg.which] =&gt; int x;<br></div>
Then when a line after that is added<div class="im"><br>
   x[msg.which] =&gt; int x0;<br></div>
it complains about this line, giving that cryptic message, despite the fact that it is correct.<br>
<br>
When the first line is accepted, that gives the impression that this name overloading is legal, though it differs from C++. Thus I started to use it.<br>
<br>
Chuck needs to make up its mind: is this name overloading legal or not. If it is not, it should always be rejected.<div><div></div><div class="h5"><br>
<br>
  Hans<br>
<br>
<br>
_______________________________________________<br>
chuck-users mailing list<br>
<a href="mailto:chuck-users@lists.cs.princeton.edu" target="_blank">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>Release me, insect, or I will destroy the Cosmos!<br>
</div>