[#407] New feature for Ruby? — Clemens.Hintze@...

Hi all,

27 messages 1999/07/01
[#413] Re: New feature for Ruby? — matz@... (Yukihiro Matsumoto) 1999/07/01

Hi Clemens,

[#416] Re: New feature for Ruby? — Clemens Hintze <c.hintze@...> 1999/07/01

On Thu, 01 Jul 1999, Yukihiro Matsumoto wrote:

[#418] Re: New feature for Ruby? — gotoken@... (GOTO Kentaro) 1999/07/01

Hi

[#426] Re: New feature for Ruby? — gotoken@... (GOTO Kentaro) 1999/07/02

Hi,

[#440] Now another totally different ;-) — Clemens Hintze <c.hintze@...>

Hi,

21 messages 1999/07/09
[#441] Re: Now another totally different ;-) — matz@... (Yukihiro Matsumoto) 1999/07/09

Hi,

[#442] Re: Now another totally different ;-) — Clemens Hintze <c.hintze@...> 1999/07/09

On Fri, 09 Jul 1999, you wrote:

[#443] — Michael Hohn <hohn@...>

Hello,

26 messages 1999/07/09
[#444] interactive ruby, debugger — gotoken@... (GOTO Kentaro) 1999/07/09

Hi Michael,

[ruby-talk:00415] Re: New feature for Ruby?

From: Clemens Hintze <c.hintze@...>
Date: 1999-07-01 15:27:25 UTC
List: ruby-talk #415
On Thu, 01 Jul 1999, Julian R Fondren wrote:
>> - Range::new(1, 9, -2) -- ERROR!
>Perhaps you should try the latest version of ruby, the absolute value of
>the third argument is used, and this works fine.

But this is a bool value (0 means false; other mean true)! It decides
whether the range is inclusive or exclusive.

>
>> The call "Range::new(1, 9)" or "Range::new(9, 1)" could also be
>> written as "1..9" and "9..1" (perhaps we could have a global function
>> "range" (like Python) which would instantiate Ranges via Range::new?).

>This is already true.
>``for x in 1..9; print "#{x}\n"; end'' works as expected
>

Sorry, but the problem is not

  for x in 1..9; print "#{x}\n"; end

but

  for x in 9..1; print "#{x}\n"; end

[...]

>I think that the features you have here (that do not already exist =)
>could be useful; it seems as if you want to make Range objects look more
>like lists without them actually being so.

No, no, no. I want to have Range objects, as they would calculate its
members on a certain position, instead of really generate a list. The
difference would be like "range" and "xrange" in Python!

Cle.

In This Thread