[#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:00413] Re: New feature for Ruby?

From: matz@... (Yukihiro Matsumoto)
Date: 1999-07-01 08:01:24 UTC
List: ruby-talk #413
Hi Clemens,

In message "[ruby-talk:00407] New feature for Ruby?"
    on 99/07/01, Clemens.Hintze@bln.sel.alcatel.de <Clemens.Hintze@bln.sel.alcatel.de> writes:

|So here are my ideas:

In summary, your proposal should be:

  (a) make Range be able to iterate reverse order if beg > end.

  (b) make step can be supplied to Range::new.

  (c) add Range#[n] to retrieve n-th item of the iteration.

  (d) make String's magic decrement possible (as magic increment).

Right?  My ideas for the proposal are:

  (a) Range is range, not interval;  I think you'd better define
      Interval class to do the work.

  (b) Ditto.  There may be the possibility of Range#step.

  (c) I'm not sure;  I'd like to hear others' opinion.

  (d) It's good.  The only reason for absence of String's magic
      increment is my laziness.  I'm happy to add magic decrement
      feature to the String class, if somebody supplies me the code
      (acutually you already did).

And your proposal

|Every class which wants to be used as Range, should implement a
|"succ", "pred" and a "compare method" to enable us to detect the end
|of iteration.

is already there, except "pred" and reverse ordering.

Concerning Interval, I'm affraid it should be restricted to the numric
intervals.  For example, by String's magic increment, "a000" never
reaches "bcde", even though latter is larger lexicographically.  It
may raise the problem sometimes.  But with numerical values, Intervals
are much easier to operate.

                                                matz.

In This Thread