[#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:00441] Re: Now another totally different ;-)

From: matz@... (Yukihiro Matsumoto)
Date: 1999-07-09 06:04:24 UTC
List: ruby-talk #441
Hi, 

In message "[ruby-talk:00440] Now another totally different ;-)"
    on 99/07/09, Clemens Hintze <c.hintze@gmx.net> writes:
|
|1. I think that the mix-in module Enumeration, could also offer a
|method `[]', as that is easy possible to realize via `each'.

You CAN define it for Enumerable, but I think we don't have to define
it.  There are some classes which can be enumerable but not indexable,
for example, Mathematical Set (non-ordered set), and Hash are such
classes.  In addition, Hash has non number indexing method [], which
may be the source of confusion if we define Enumerable#[].

|2. The operators `..' and `...' cannot be overwritten!

Yes, it's part of the syntax.  Because dots operators appears at
condition, they work differently.  In reference manual:

   If range expression appears in conditional expression, it gives false
   until left hand side returns true, it stays true until right hand side
   is true.  .. acts like awk, ... acts like sed.

It is possible to call ../... method outside of condition.  It makes
behavior of the operators bit complex, so we need to discuss about it.
I'm not sure stepping forward (i.e. make ../... method call) is
suitable or not.

Personally, I don't like mapping operators to method very much.
But it is needed to make Ruby handy.  I prefer generic function style
as in CLOS for mathematical operators, where operands are conceptually
equal.  But that is too much for the language, enough to abandon to
include in Ruby.
                                                matz.

In This Thread