> > 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