Dan Sugalski writes: > The slice vtable entry should take as its parameter a slice pmc. This > should be an array of typed from/to values, so we can do something > like: > > @foo[0..2,4..8,12..]; > > with three entries in the slice array--one with a from/to of 0/2, one > with 4/8, and one with 12/inf.
Perl also has: @foo[0..12 :by(3)] # 0,3,6,9,12 PDL has affine slices. To me, it seems like the best thing to do is to give slice an iterator, and slice would return an iterator that maps keys to values. So, doing C<@bar = @foo[0..2,4..8,12...]> would look something like: Construct iterator for 0..2, 4..8, 12... Call @foo->VTABLE_slice(iterator) Initialize @bar from returned iterator Iterators have the advantage over arrays since they can be infinite. With arrays, how do you represent: @foo[12... :by(3)] Do we still have multidimensional keys? Luke