The ideas I'm (slowly) playing with for ranges:

     Extend the Range so that either or both ends can be 
         inclusive, exclusive or unbounded (i.e., open, closed, or
         infinite)

     Define construction operators '<..<', '<=..<', '<..<=' and '<=..<='
     Likewise '<.._', '<=.._', '_..<=' and '_..<' 
         (the last two being unary prefixes)
     Keep '..' as an alias for '<=..<='
     Keep '...' as an alias for '<=..<'
     Define construction operator '..+' for the start/length-1 case
     Define construction operator '..<+' for the start/length case

     Add Range#by(step)

     Defining a related class for "disordered" ranges like "2..-1" which
          are handy but semantically disjoint for pure ranges.  I'm
          thinking something that water would roll off the back of in 
          a duck typing world, but that would raise reasonable error
          messages in preference to producing unexpected behaviour.

Typically, the versions of ruby I produce in these experiments are
killed by angry villages before they can show their essential
kindheartedness.  But I still hope.

    -- Markus

P.S.

On Mon, 2004-10-04 at 20:36, trans. (T. Onoma) wrote:
> On Monday 04 October 2004 09:09 pm, Charles Comstock wrote:
> > Yes but [start,length] is capable of expressing ranges that make no
> > sense using [range].  For instance:
> >
> > a = [:a,:b,:c,:d,:e,:f,:g,:h]
> > a[-2,2] # => [:g,:h]
> > a[-2..2] # => []
> > a[-2..-1] # => [:g, :h]
> > a[0..-1] # => [:a,:b,:c,:d,:e,:f,:g,:h]
> >
> > Obviously it isn't too hard to convert between the two formats, but many
> > times it makes far more sense to express it in the [start,length] format
> > as opposed to the range format of start..end.
> 
> Hmm... It's still signifies a range. So if there were just a notation, then it 
> might be nice. I'm not sure what that would be though.
> 
> Really, in looking over Ruby's Range class, it is bit limited. You can't 
> exclude the start element, and it doesn't provide a way to specify a 
> increment so you can't iterate over floats. A more complete range would have 
> the initializer something like:
> 
>   Range.new(start, end, start_exclude=false, end_exclude=false, inc=1)
> 
> Again, sure the best way to make a nice neat literal notation for all that. 
> Although one simple suggestion is to have a '+' method to set the increment.
> 
>   (1.0 .. 3.0 + 0.5).to_a  #=> [1.0, 1.5, 2.0, 2.5, 3.0]