Fernando Guillen wrote: > David A. Black wrote: >> On Sat, 27 Jun 2009, Fernando Guillen wrote: >>> That looks great, so the Class.initialize method admit a block as a >>> parameter and the block becomes on the definition of the Class >>> instance.. (I am trying to find the ruby source-code of Class but I can >>> not find it on my computer.. :/) >> If you have the source code installed, look for class.c (and the >> closely related module.c). > I though that Class class (also String class, Integer class and so on) > was implemented on ruby code. That depends on what implementation you are using. > But with your answer I think this classes > are implemented directly on C.. it is that correct? No, it is not correct. Every implementation implements them differently: XRuby and JRuby implement them in Java, IronRuby and Ruby.NET implement them in C#, Red Sun in ActionScript, Cardinal in PIR, MacRuby in Objective-C, MRI, YARV and tinyrb in C. Only Rubinius and MagLev implement them in Ruby, at least partially. In Rubinius, a tiny bit of core functionality of modules and classes is implemented inside the C++ VM, but the majority of functionality is written in Ruby. The MagLev sourcode is not publicly available, but AFAIK Ruby classes are implemented using Smalltalk classes with glue code written in Smalltalk and compatibility code written in Ruby. jwm