From: Robert Feldt Date: 2001-10-14T11:15:14+09:00 Subject: [ruby-talk:22503] Re: Open-ended ranges On Sun, 14 Oct 2001, Sean Russell wrote: > Occasionally, I encounter a situation where having an open-ended range > would be nice... or, more accurately, a default MAX value. For instance, > I'd sometimes like to say: > > (1..) # to infinity and beyond! > Ruby doesn't have infinite or unbounded data (by default) structs so what should this mean? We would have to add Inf (might be good for other situations) and introduce Object#default_max_value, but how to handle (1..).to_a without going for lazy evaluation? > Yeah, the last case only saves two characters, but you get the idea. First: > > 1) does anyone else think this would be useful? > I'm skeptical, but maybe your answers to my q's above can make me change my mind?! ;-) > 2) would this complicate the Ruby interpreter/parser needlessly? > Probably... > PS. I was following the "versioned require" discussion for a while, but it > seems as if talk surrounding it has died out. Is anyone still working on > this? I'd *really* like a standard way of saying: > > require "somemodule/someclass" (2.0..3.5) > Many people seem to think that something along those lines would be a good thing. There is not yet a consensus on which semantics to use and how to implement. Maybe the RAA.succ/RubyGems discussion/solution can revive this discussion again? Regards, Robert