Larry -- > Simon Cozens writes: > : Gregor N. Purdy: > : > I was only involved in a small amount of 'key' discussion. FWIW, I > : > would have thought the KEY_PAIR thingee was for (array) slice ranges, > : > not multidimensional indexing... > : > : Then it's doubly mis-named, because KEY_PAIR holds a single key, not a > : pair of anything, and KEY holds a bunch of KEY_PAIRs. > > I just think of multidimensionality as another "list of" dimension on > top of the slices. Alternately, you can think of it as another > dimension on each leaf that turns each scalar into a list. But the > extra dimension has to sneak in there somewhere if we're to allow > multidimensional slicing.
GP$0.02: I think of slicing as a shortcut for map. foo[1,2,3] === map { foo[$_] } (1,2,3) I think of multidimensionality as arrays-of-arrays: foo[1][2] As for combining the two, I guess that would be foo[1,2][3,4] =~= temp = map { foo[$_] } (1,2); map { temp[$_] } (3,4) or maybe even something like =~= map { my $a = $_; map { foo[$a][$_] } (3,4) } (1,2) (with an official frown for that temp variable. Some kind of temp/scope trickery would be nice to avoid naming it when writing nested constructs such as that) I think of ranges as being lazy lists. Under flattening, they remain generators and cause the the flattened list to also be lazy so that when the ranges are encountered they DTRT. Optimization might cause short ranges to explode so we don't have too much time overhead for (1..5), while still avoiding space overhead for (1...1000000). Regards, -- Gregor ____________________________________________________________________ / Inspiration >> Innovation >> Excellence (TM) \ Gregor N. Purdy [EMAIL PROTECTED] Focus Research, Inc. http://www.focusresearch.com/ 8080 Beckett Center Drive #203 513-860-3570 vox West Chester, OH 45069 513-860-3579 fax \____________________________________________________________________/ [[EMAIL PROTECTED]]$ ping osama.taliban.af PING osama.taliban.af (68.69.65.68) from 20.1.9.11 : 56 bytes of data. >From 85.83.77.67: Time to live exceeded