From: Robert Klemme Date: 2008-05-20T17:52:12+09:00 Subject: Re: Why is Array#to_f not defined? 2008/5/20 Fredrik : > I see... I understand that it is not following the rule of "converting > the receiver to a float", but I would say that it follows the > "principle of least surprise". That may be true for you, but it is not for me - and apparently others as well. > Of course it is not possible to convert an Array to a Float in any > meaningful way, so to convert each element into a Float is the > behaviour I am expecting. Well, Array#to_f could be defined like this: class Array alias :to_i :size def to_f; to_i.to_f end end This is much more meaningful to me than making to_f a conversion of each element to float. Note, I do not advocate this at all - all I am saying is that there are more meaningful implementations of to_f than the one you propose. > Well... that's my thinking anyway. Exactly. :-) Kind regards robert -- use.inject do |as, often| as.you_can - without end