"Bulat Ziganshin"  wrote
....
> Wednesday, October 02, 2002, 5:47:58 PM, you wrote:
> >>   def init(MyType xyz)
>
> PB> This does not look like valid Ruby code?
>
> yes. in current ruby way to define an explicit conversion is a bit tricky :)

I am wondering if you intended to write

class Float
    def initialize(MyType arg)
        ...
    end
end

(note Float.new is currently disable and I don't see any reason
to change this ...) .  Assuming that Ruby had overloading
you could write this as

def Float(MyType arg)
    ...
end

but  this can, as Goto pointed out,  already be done (imo more
elegantly) by delegating the conversion to the MyType class

module Kernel
    def  Float(arg)
        arg.to_float  # or to_flt
    end
end


/Christoph

/Btw . Following  C++'s example of mixing type
conversion and  overloading is imo a  really
terrible idea ..