On Fri, May 22, 2009 at 7:30 PM, Jp Hastings-spital <jphastings / gmail.com> wrote: > Brian Candler wrote: >> That's because you can't do Float.new either. > > So, out of interest, how does a Float get initialized (what function is > called)? Or is that some fancy inbuilt something-or-other? > Logically I'd assume I'd be able to do > ¨Âùßðã Ðåòãåîôáçå °®> or something along those lines. What do you reckon? This is what happenes in numeric.c rb_cFloat = rb_define_class("Float", rb_cNumeric); rb_undef_alloc_func(rb_cFloat); rb_undef_method(CLASS_OF(rb_cFloat), "new"); Probably for some good reasons, however *you* are king irb(main):001:0> class Float irb(main):002:1> def self.new x irb(main):003:2> Float( x ) irb(main):004:2> end irb(main):005:1> end => nil irb(main):006:0> class W < Float irb(main):007:1> end => nil irb(main):008:0> x=W::new 42 => 42.0 How floats get initialized? I dunno, but it is my guess that the parser generates some code very similar to what is in Kernel#Float. But for some reason my grep skills elude me to find the code of Kernel#Float. > -- > Posted via http://www.ruby-forum.com/. > > -- Toutes les grandes personnes ont dÃÂbord ñÕdes enfants, mais peu dÃÆntre elles sÃÆn souviennent. All adults have been children first, but not many remember. [Antoine de Saint-ExupñÓy]