On Wed, Jul 21, 2004 at 12:39:57PM -0600, Luke Palmer wrote: > Jonathan Scott Duff writes: > > On Wed, Jul 21, 2004 at 07:35:08PM +0200, Aldo Calpini wrote: > > > Larry Wall wrote: > > > > > > >Hmm. That makes me wonder what the slice notation for "everything" is. > > > > > > > > > > > maybe @foo[..] (a short form for @foo[0..Inf]) ? > > > > Surely you mean [EMAIL PROTECTED] instead of 0..Inf > > Same diff. The following are all identical > > @[EMAIL PROTECTED] > @foo[0..Inf] > @foo[0...] > > Unless you're assigning... in which case the latter two are probably > more like what you want than the former.
Somehow I doubt that. If I'm in a loop that continually adds to an array and I want snapshots of how the array looks at particular points, I don't think that 0..Inf will do it. Maybe it will. Is "Inf" a magic token that really means something like "look at your surrounding context and return the index of the last element of the structure you're iterating over"? Because, pragmata aside, I'd expect 0..Inf to iterate forever (lazily, but still forever) including past the end of my arrays. -Scott -- Jonathan Scott Duff Division of Nearshore Research [EMAIL PROTECTED] Senior Systems Analyst II