Joe Groff <arc...@gmail.com> wrote: > Jon Harper <jon.harpe...@gmail.com> wrote: >> - Why isn't already in the library ? Do multi-dimensional arrays > I think because arrays-of-arrays have been sufficient so far. > Two-dimensional arrays aren't needed all that often, and > higher-dimensional arrays hardly at all.
APL, J, and K programmers would disagree :-). If we don't have a hammer, nothing looks like a nail. I hope the answer is "because we're waiting for someone who really knows multidimensional arrays to design the API." I can't help there, but I know a couple of people who can, if they're willing (extensive previous experience with array and concatenative languages). > useless. If you want a packed multidimensional array type, it would be > more robust to implement it as a virtual sequence over a > single-dimensional array, where each element would be a slice of that > array representing a row (or column). The array language J stores multidimensional arrays as a "shape" array, followed by a flattened array accessed by multiplying the indices by the appropriate parts of the shape -- or, when one is iterating over an array, by simply iterating over the flattened version of the array (most operations in those array languages iterate in that way). (I don't know how K does this, because K supports ragged arrays, where different elements can have different lengths; obviously, ragged arrays can't be stored in that particular compact format.) > -Joe -Wm ------------------------------------------------------------------------------ ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo _______________________________________________ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk