[chuck-users] Static data problem (arrays, floats)

Kassen signal.automatique at gmail.com
Tue Sep 15 10:04:11 EDT 2009


Andrew,


> Thanks, that works perfectly. How does setting the length at
> initialization make logical sense? I mean that in a curious, not a
> critical way. I'm just not sure what the nature of the issue is,
> because it seems like declaring a single primitive is the same as
> declaring 128 of them, right? (clearly wrong).
>
>
Yes, in the case of primitives. However arrays are objects and i think it's
the object that needs to be initialised. Remember that instead of floats we
might have a array of "fozzbobs" where a "fozzbob" is some class that
consists of 10k lines. I think ChucK treats those as more or less the same
here.

I agree that it feels a bit "unfair" here but remember that a array of
floats is more than just a series of primitives. You also get .cap(),
.size(), you can append to it, etc. It's a real object.



> And anyway, who needs examples when you have a list? Think of all the
> people we would never meet (figuratively) in a world of perfect
> documentation.
>
>
Well, now you had to wait for a answer for me to get round to "morning
coffee", that's one side. I think another is that not all users are on the
list and that perhaps some are too shy/modest to email questions. I'm not
sure why that is but I suspect it's so. For a third reason; this is just a
simple trick to get around the issue, it's not very exciting. I'd rather
stuff stuff like that in the examples dir so we could get round to exciting
things like how, when and why we would actually do things like this.

Yours,
Kas.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20090915/f2461ae1/attachment.html>


More information about the chuck-users mailing list