From: David Naseby Date: 2003-11-06T14:46:29+09:00 Subject: Re: Managing metadata about attribute types > >Hmm .. by the way, aren't you arguing against duck-typing here? >If someone deliberately creates a type which is *like* a Float, then >this code would force it to be a real float (assuming that to_f returns >a real Float object). Just weighing in with a small point, but 1.0.to_f #=>1.0 A type *like* a float responds to to_f, to give a float. For any type to act like a float, it must quack like a float, in the sense it gives a meaningful float when it hears to_f. #to_x messages are just messages. It is not casting - unless you are wacky enough to write a #to_f! method. Its asking the object to show its face as a float. David.