[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ruby-talk
Subject:    Re: String#to_ary and Test::Unit
From:       "Trans" <transfire () gmail ! com>
Date:       2005-08-08 11:51:08
Message-ID: 1123501819.852909.36180 () o13g2000cwo ! googlegroups ! com
[Download RAW message or body]


Martin DeMello wrote:

> each_byte, each_word and
> each_line (without any default 'each') should provide most of the
> functionality people need anyway

Those really aren;t very good. Oe ends creating all sorts of methods
along these lines:

  freq_bytes, freq_word, freq_lines.

I suppose the best way would be:

  arr.bytes.freq, arr.words.freq, etc.

So I agree with you even more. There are really two reasonable choices.
Either make String#to_a consistant, with the obvious definition being
split(//), or remove Enumerable altogether. As it stands it is a bit
confusing, mostly useless, and a likely potential for creeping bugs.

T.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic