On Nov 18, 2007 6:50 PM, Clifford Heath <no / spam.please.net> wrote:
> Folk,
>
> I found Sean Russell's 2001 posting on this subject, and had a play with creating
> open ranges using of class instances - interesting to find you can even do this!
>
> What I really want is to be able to define ranges like (1..nil), which is an
> open-ended range starting from 1.

a = []; a[42]
=>nil

You have, already, tools at your disposal for indefinite ranges of numbers.

Somebody please explain to me what good is a Range object that goes
from 1 to something_undefined?  Maybe my SQL background is revealing
itself, but am I being stupid in thinking that this is just plain the
power of flexibility gone awry?  I'm seeing a language discontinuity
if people start using this.  I get the whole concept of 1 to the
unknown, but unknown to me means I don't even know if it's a Fixnum.

Set.new(1..nil) - Set.new(5..nil)

Is nil supposed to represent infinity?  What if we introduce reverse
ranges (i.e. 5..-1).  What then does nil represent in a similar line?

Todd