David A. Black wrote:
> Hi --
> 
> 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. But with your answer I think this classes 
are implemented directly on C.. it is that correct?

> 
>> Now, what about inheritance? I mean: how to reproduce the behavior of
>> this?:
>>
>>  class A < B
>>  end
> 
> Class.new(B)  # inherit from B

oook.. and this works too:

  C = Class.new(B) do
    def instance_method
      puts "hi from instance"
    end
    def self.class_method
      puts "hi from class"
    end
  end

Thanks again

f.
-- 
Posted via http://www.ruby-forum.com/.