On 2009/06/08 0:27, Eero Saynatkari wrote:
> Excerpts from Yukihiro Matsumoto's message of Sun Jun 07 17:07:06 +0300 2009:
>> Hi,
>>
>> In message "Re: [ruby-core:23743] [Bug #1583] Time + String no Longer Raises
>> TypeError?"
>>      on Sun, 7 Jun 2009 13:00:26 +0900, Akira Tanaka<redmine / ruby-lang.org>  writes:
>>
>> |I like to_rat.
>>
>> #to_rat alone?  Or along with to_flo, to_comp, to_dec, etc?
>
> Since some of these names will inevitably turn out to be
> somewhat hard to decode at first glance, might it be an
> option to consider establishing a convention different
> from the #to_i =>  #to_int style and make it #to_i and
> #as_i (or #to_int and #as_int) instead?
>
> #to_<typeish>  produces a representation of object, as #to_s.
> #as_<typeish>  "converts" object to type, as #to_str.

Another opinion would be to use somewhat longer names where three 
letters isn't helpful. When I saw to_rat first, I was first thinking of 
a little rodent. #to_rational isn't that long, for the number of times 
it needs to be used, I guess.

Regards,   Martin.

> In my opinion, the symmetry would be helpful and the two
> different prefixes help separate their responsibilities?
> Of course, it is a departure from past semi-convention.
>
>
> Regards,
>          Eero
>
> --
> Magic is insufficiently advanced technology.
>
>
>

-- 
#-# Martin J. Dürst, Professor, Aoyama Gakuin University
#-# http://www.sw.it.aoyama.ac.jp   mailto:duerst / it.aoyama.ac.jp