From: Robert Dober Date: 2009-06-27T23:15:43+09:00 Subject: Re: Trying to define a 'class' without using 'class' sentence On 6/26/09, Fernando Guillen wrote: > 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] and from within Ruby there are several pieces of information you might find useful: http://pastie.org/526389 HTH Robert -- Toutes les grandes personnes ont d’abord été des enfants, mais peu d’entre elles s’en souviennent. All adults have been children first, but not many remember. [Antoine de Saint-Exupéry]