Jörg W Mittag wrote: > 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. Thanks for the explanation. How can I know with Ruby interpreter I am using? $ ruby --version ruby 1.8.6 (2008-08-11 patchlevel 287) [universal-darwin9.0] f. -- Posted via http://www.ruby-forum.com/.