[#1026] Is this a bug? — Dave Thomas <Dave@...>

18 messages 2000/01/03

[#1084] Infinite loop — Dave Thomas <Dave@...>

17 messages 2000/01/11

[#1104] The value of while... — Dave Thomas <Dave@...>

24 messages 2000/01/11

[ruby-talk:01189] Re: Enumerable and index

From: gotoken@... (GOTO Kentaro)
Date: 2000-01-28 00:52:08 UTC
List: ruby-talk #1189
In message "[ruby-talk:01188] Enumerable and index"
    on 00/01/27, Dave Thomas <Dave@thomases.com> writes:

>Should there be a method Enumerable#index? It's documented in the 1.4
>html, and array and hash implement an override, but it doesn't seem to 
>be in enum.c.

`index' is not helpful because one cannot access the object after
calling of `each' via `index' for some classes, e.g., IO. It was the
reason of discarding, maybe. `size' and `length' were obsoleted too.

However, we have another option, i.e., !IO<Enumerable.  To discuss
this problem, we should obtain `What is Enumerable?'.  In current
Ruby, Enumerable means a sequential access object at least once while
the another says Enumerable means Array interface.  Cle and Matz
disscussed ago.  

-- gotoken

In This Thread