> > Well, first of all,
> >
> > 10:100, 30:200
> >
> > is not the same: in Perl it comes out as
> >
> > 10..100, 30..200
> >
> > 10, 11, ... , 100, 30, 31, .., 200
> >
>
> Additionally, generically it would not necessarily have to be a range of
> integers. The range could be specified as floating point if we are
> specifying a slice in physical coordinates.
If someone is going to write the RFC, remember also the third arg:
a:b:c
is the sequence
a, a+c, a+2*c, ... a+n*c
where n is the largest integer such that a+n*c <= b (important that it's
greater than or equal!).
a:b
is always the same as
a:b:1
Also, the usual Perl index tricks should work (these should be specified
in the span so that the code interpreting the span can use its knowledge):
: # all the things on this dimension: full span
5:-1 # 5..last
5:-1:2 # Every second item, up to the last or second last
-1:7:3 # Start with last item, then fourth last, etc. until 7.
Note that there need to be different contexts: if floats or negative
integers are allowed then -1 cannot stand for the end but it has to stand
for -1.
Tuomas
- Re: Contexts [was:Reduce[Re:]... raptor
- Re: Contexts [was:Reduce[Re:]... Piers Cawley
- Re: Contexts [was:Reduce[Re:]... raptor
- Re: Reduce [was: Re: Random items... Jeremy Howard
- Re: Reduce [was: Re: Random i... Martyn Pearce
- Re: Reduce [was: Re: Random i... Jeremy Howard
- Re: PDL-P: Re: Reduce [was: R... Karl Glazebrook
- Re: PDL-P: Re: Reduce [was: R... Ariel Scolnicov
- Re: PDL-P: Re: Reduce [was: R... Tuomas Lukka
- Re: PDL-P: Re: Reduce [was: R... Tim Jenness
- Re: PDL-P: indexing Tuomas Lukka
- Re: PDL-P: indexing Joshua N Pritikin
- Re: PDL-P: indexing Jeremy Howard
- Re: PDL-P: Re: Reduce [was: R... Ariel Scolnicov
- Re: PDL-P: Re: Reduce [was: R... Jeremy Howard
- Re: PDL-P: Re: Reduce [was: R... Karl Glazebrook
- Re: Random items (old p5p issues) Graham Barr
- Re: Random items (old p5p issues) Alan Burlison
- Re: Random items (old p5p issues) Randal L. Schwartz
- Re: Random items (old p5p issues) Dan Sugalski
- Re: Random items (old p5p issues) Jeremy Howard
