2008/5/20 Fredrik [email protected]:
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
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:
alias :to_i :size
def to_f; to_i.to_f 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.