<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
In some languages (like C) multi-dimensional arrays do need to be rectangular.  This is because it's really just one big array.  i.e. If you<div><br class="webkit-block-placeholder"></div><div>int foo[2][3];</div><div><br class="webkit-block-placeholder"></div><div>you're doing exactly the same as</div><div><br class="webkit-block-placeholder"></div><div>int foo[6];</div><div><br class="webkit-block-placeholder"></div><div>except that the compiler will do a bit of sugar for you and multiply your outer index by the inner array size and add it to your inner index.<br><div><br class="webkit-block-placeholder"></div><div>In java this is not the case because each index into your outer array is infact a ref to an array object.</div><div><br class="webkit-block-placeholder"></div><div>_Mark</div><div><br><div><div>On Oct 3, 2007, at 6:54 AM, Kassen wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><br><br><div><span class="gmail_quote">On 10/3/07, <b class="gmail_sendername">Spencer Salazar</b> &lt;<a href="mailto:ssalazar@cs.princeton.edu">ssalazar@cs.princeton.edu</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> It makes sense when you think of multi dimensional arrays as just<br>arrays of arrays.  Additionally each sub-array need not be of equal<br>length.  </blockquote><div><br><br>Ah! I didn't think your could do that, I had assumed the  sub-arrays needed to be equal length. <br><br>In that case I withdraw my comment about the need for the index being ugly, obviously. In that case it's also quite coherent that we need ask to get the .cap() for higher dimensions in exactly that way but I still think a note about this in the manual couldn't hurt. <br><br>Thanks for the demonstration!<br><br>Kas.<br></div><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">_______________________________________________</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">chuck-users mailing list</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><a href="mailto:chuck-users@lists.cs.princeton.edu">chuck-users@lists.cs.princeton.edu</a></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</a></div> </blockquote></div><br></div></div></body></html>