<div dir="ltr">I was getting a bit frustrated, but it is definitely possible to get this to work properly.  I had code that did something like<div><br></div><div>ar.size(siz);</div><div>for (0 => int i; i < siz; i++) {</div>
<div>SinOsc s;</div><div>s => ar[i];</div><div>}</div><div class="gmail_extra"><br></div><div class="gmail_extra">which didn't work, but changing it to "s @=> ar[i]" *did* work, which makes sense, since the interpreter/compiler might reasonably think I was chucking something to ar[i], a null pointer.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">I think my grumbling may have been a bit premature in this case.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Thanks for all the help!</div><div class="gmail_extra">
<br></div><div class="gmail_extra"> - George<br><br><div class="gmail_quote">On Sun, Feb 2, 2014 at 5:27 PM, Stefan Blixt <span dir="ltr"><<a href="mailto:stefan.blixt@gmail.com" target="_blank">stefan.blixt@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 dir="ltr">My guess is that it inserts null pointers into the array as you expand it, which doesn't feel totally unreasonable. For primitives there's usually intuitive default value that the compiler can use, with objects (that need allocated resources for their instances, which could be either the declared type or a subclass), null is the logical default.</div>

<div class="gmail_extra"><div><div class="h5"><br><br><div class="gmail_quote">On Sun, Feb 2, 2014 at 10:54 PM, George Locke <span dir="ltr"><<a href="mailto:george.locke.maxmsp@gmail.com" target="_blank">george.locke.maxmsp@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 dir="ltr">that works.  i'm surprised that the .size method doesn't work, tho, since it does work on primitive type arrays.  I guess there's no instantiation happening or something...<div>

<br></div><div>Thanks!</div><span><font color="#888888">
<div><br></div><div> - George</div></font></span></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Feb 2, 2014 at 4:24 PM, Perry R Cook <span dir="ltr"><<a href="mailto:prc@cs.princeton.edu" target="_blank">prc@cs.princeton.edu</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">   5. how do you resize an object array? (George Locke)<br>
<br>
Here's something that should be useful.<br>
(from the .pdf ChucK Manual, under Dynamic Arrays,<br>
there's more there about it)<br>
<br>
<br>
[64, 65, 60, 59] @=> int notes[];<br>
<br>
notes << 58; // notes is [64, 65, 60, 59, 58]<br>
notes << 60; // notes is [64, 65, 60, 59, 58, 60]<br>
<br>
notes.popBack(); // [64, 65, 60, 59, 58]<br>
<br>
notes << 64 << 65 << 60; // [64, 65, 60, 59, 58, 64, 65, 60]<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>
</blockquote></div><br></div>
</div></div><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>
<br></blockquote></div><br><br clear="all"><div><br></div></div></div><span class="HOEnZb"><font color="#888888">-- <br>Release me, insect, or I will destroy the Cosmos!
</font></span></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></div></div>