From: James Edward Gray II Date: 2007-04-04T22:01:03+09:00 Subject: Re: Everything is a object? On Apr 4, 2007, at 7:10 AM, tsela.cg@gmail.com wrote: > On Apr 4, 12:19 pm, Jamal Soueidan wrote: >> I thought keywords are class, def, end, which mean something to the >> compiler only. >> > > Indeed, and so are begin, rescue, defined?, if, else, and a few > others. See http://ruby-doc.org/docs/ProgrammingRuby/html/ > language.html#S3 > for a list of the reserved keywords in Ruby. But I don't think your > view of keywords as being things "which mean something to the compiler > only" is correct. See keywords just as they are: reserved names that > you may not use as method or variable names since they are already > used by the language to mean something specific and unchangeable. I don't think that's a good definition: >> class Example >> def begin >> "I'm a method, not the keyword!" >> end >> end => nil >> Example.new.begin => "I'm a method, not the keyword!" Ruby's a pretty clever girl. ;) James Edward Gray II