[chuck-users] Mixing associative with integer indexed arrays? (multiple BUGS)

Kassen signal.automatique at gmail.com
Sat Nov 22 01:05:49 EST 2008

2008/11/22 Stephen Sugden <glurgle at gmail.com>

> Thanks kassen,

You're welcome!


> I thought I should mention that this line:
> [ 0, 2, 4, 5, 7, 9, 11, 12 ] @=> int melodies[0];
> Crashing chuck doesn't seem like a bug to me, because I had created
> melodies as a two dimensional array with both lengths defined
> (melodies[10][88]) and that's why it worked for me. Whereas if melodies
> isn't created yet, assigned something to index 0 shouldn't necessarily work.

Well, I agree it's dubious, even if doing it in two (explicit) stages like
this does work;

int melodies[0];
[ 0, 2, 4, 5, 7, 9, 11, 12 ] @=> melodies;

However, the reason I call it a bug is that it crashes ChucK, taking out the
whole VM. Ge once said that should never happen so I "stamp" anything that
does that with the "bug label". Parser errors are good, exiting the shred
with a warning is fine, simply quitting is not fine, no matter how blatantly
silly the stuff I type at times (I'm not especially proud of finding that
spelling "class" with a capital "C" will crash...). To be sure; this was my
mistake, not yours, but since it crashes like that it's still a bug.

> I can certainly live with integer indexes in my script, and I'll see about
> adding the bug to the wiki...

You should only have to live with them temporarily; your code, aside from
the way you wanted to print, was according to the language specs as I read
them; you were right, ChucK was wrong.

Give a shout if the Wiki gives you trouble and I'll do it but it should be
there; we have a list like that for the dev's to use as a reference and for
us to make sure we don't doulbe-report issues.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20081122/1695758e/attachment.html>

More information about the chuck-users mailing list