[chuck-users] Dynamic Arrays (George Locke)

George Locke george.locke.maxmsp at gmail.com
Sun Feb 2 16:54:42 EST 2014


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...

Thanks!

 - George


On Sun, Feb 2, 2014 at 4:24 PM, Perry R Cook <prc at cs.princeton.edu> wrote:

>    5. how do you resize an object array? (George Locke)
>
> Here's something that should be useful.
> (from the .pdf ChucK Manual, under Dynamic Arrays,
> there's more there about it)
>
>
> [64, 65, 60, 59] @=> int notes[];
>
> notes << 58; // notes is [64, 65, 60, 59, 58]
> notes << 60; // notes is [64, 65, 60, 59, 58, 60]
>
> notes.popBack(); // [64, 65, 60, 59, 58]
>
> notes << 64 << 65 << 60; // [64, 65, 60, 59, 58, 64, 65, 60]
>
> _______________________________________________
> chuck-users mailing list
> chuck-users at lists.cs.princeton.edu
> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20140202/9e42871b/attachment.html>


More information about the chuck-users mailing list