On Sun, May 1, 2011 at 8:15 AM, Konstantin Ka <paranox3 / yahoo.de> wrote:
>
> That being said, since everything in Ruby is an Object and in one way or
> another belongs to the Object-Class, I'd like to see the code of that.

You can!

Just download <http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p180.tar.gz>,
extract, and start digging through the C code.

Or grab Rubinius' source code to see Ruby implemented in Ruby. Or
JRuby to see it in Java. Or IronRuby to see it in .NET/C#.

Or grab all four to compare them side by side.

> How would one define the method ".def"?

Not everything in Ruby is a method. There's keywords which are neither
objects nor methods, too. class, def, end, or if belong to this group.


> These questions seem fairly basic to me, but none of the beginner guides
> I found even came close to explaining this. So please point me in the
> right direction.

Language implementation isn't usually a beginner's topic. ;)

But books I can recommend:
- Eloquent Ruby, by Russ Olsen
- The Ruby Programming Language, by our very own Matz.*
- Programming Ruby, 3rd Edition**

All these books dive into the how and why Ruby does things.

* based on hearsay; I haven't read the book myself. Yet.
** I own the 2nd edition of the Pickaxe which covers Ruby 1.8 and is
excellent; the 3rd edition covers Ruby 1.9 in the same depth.

-- 
Phillip Gawlowski

Though the folk I have met,
(Ah, how soon!) they forget
When I've moved on to some other place,
There may be one or two,
When I've played and passed through,
Who'll remember my song or my face.