-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 i'd like to know if chuck has what i'm going to think of as arrays, that is for a variable foo, foo(1) is 4 foo(2) would be something else other than 4, and so on. then there'd hafta be a way to determine how many elements were in foo in the first place -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJOMLArAAoJEIaKvi7tbzRHdyUIAJE16MEAatNUKrnHCcFVqUlL 4wtYr+qs8KNaYeEKvtnTb0xx+QBBIMHSZvgaY2CApdtke8ocorRCufshFymHpWq7 jLBf60LqIdTIe93NL0y47VSMXwg5jQXMY5uaTNG7pzuWkjZBdm91md99cTnetAGk K7z9iVB5/8WZU5e4IsaS3aY2m9n55/pRisIc5Ot2lg4ZLy3E6dZJR83PPQdZYGIL ChBxhSJXrB/3rW7bue4Qznac5+muaMjq4TwuFQ/VQS0mU9xewqosSU2hq9/KJcbK K2WaPqMOgGt7ddK8qeEYdNfaGQ0c8jdSEluz1JuLkycyKJnZ1hojqfIwWJbkG0o= =2OWX -----END PGP SIGNATURE-----
On Wed, Jul 27, 2011 at 7:41 PM,
i'd like to know if chuck has what i'm going to think of as arrays, that is for a variable foo, foo(1) is 4 foo(2) would be something else other than 4, and so on. then there'd hafta be a way to determine how many elements were in foo in the first place
Yes, ChucK has arrays int foo[10]; 4 => foo[1]; 42 => foo[2]; foo[Math.rand2(0, 9)] => int sample; http://chuck.cs.princeton.edu/doc/language/array.html or if you would prefer Java-style Lists IntArrayList list; list.size(10); list.set(1, 4); list.set(2, 42); list.sample() => int sample; https://github.com/heuermh/lick/wiki or if you would prefer Lisp-style Lists, there is such library code out there but I can't remember where it is or who wrote it, try searching the chuck-users@ mailing list archives. Cheers, michael
On 28 July 2011 04:04, Michael Heuer
Additionally, the manual spends a chapter on it (chapter 6, which starts at page 42). You can find the pdf in the /doc/ directory of your ChucK folder. It doesn't cover everything, but it's a good start, I think. Yours, Kas.
participants (3)
-
Kassen
-
Michael Heuer
-
tempjayren@gmail.com