From: Stu Date: 2013-02-21T08:15:30+09:00 Subject: Re: THE CLASS/OBJECT CHICKEN-AND-EGG PARADOX Xavier - Meta-Programming Ruby is a decent book which explains a bit better on your question. Though Blacks book is a better book for just starting ruby it mainly is just a beginners book. It may be helpful to understand what a Module is in ruby and how it's used with classes in ruby's object model. Also you'll want to investigate what a Eigenclass class is and what singleton methods are. Also note how ruby's reflection and method lookup syntax may always be telling the whole truth. Mainly this has to do with scoping rules and hidden classes as well to allow embedded languages within ruby which can be seen in ruby's recursive style iteration syntax methodology. One way to visualize it outside of the repl would be to consider that lookup begins at the instance object's receiver and moves to the right and then up. Showing the C code would be to see what the actual implementation is doing. If you were to view it as a flattened set of instructions a reference pointer would simply be a hash which simply is a two dimensional array. If your interested in reading ruby implemented in ruby instead of c check out Rubinius and install pry. Rubinius is a smalltalk based vm written in c++( iirc) at the bootstrap level and written in pure ruby beyond that. Of course if object based programming is new to you it's also necessary to grok what self is and how message sending and communication works. Consider it just the one of the many programming models which ruby has at the end users disposal. ~Stu On Wed, Feb 20, 2013 at 4:03 PM, Xavier R. wrote: > Matt Mongeau wrote in post #1098076: >> It's not really a paradox. Take for example >> irb(main):001:0> a = [] >> => [] >> irb(main):002:0> a << a >> => [[...]] >> > > Is it possible to give some small ruby code in-contrast with C - code > for better understanding. > > That might clear the picture more clearly. > > > Thanks > > -- > Posted via http://www.ruby-forum.com/. >