[chuck-users] .cap() for multi-dimensional arrays

Kassen signal.automatique at gmail.com
Mon Oct 1 00:47:03 EDT 2007


Fellow ChucKists....

First; .cap() for multi-dimensional arrays isn't documented but works.

If we have this;
int foo[3][5];

then this;
<<<foo.cap()>>>;
will return "3". We can get the 5 by using this;

<<<foo[0].cap()>>>;

Other numbers then 0 are also supported as long as it smaller then foo.cap()
(otherwise we get a array out of bound error) so 0 is safest.

Next up; is this correct? The need for that "0" strikes me as rather
in-elegant but omitting it results in a syntax error.

Yours,
Kas.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20071001/ac6993fb/attachment.htm 


More information about the chuck-users mailing list