Trans
10/22/2008 7:06:00 PM
On Oct 22, 7:25=A0am, Sebastian Hungerecker <sep...@googlemail.com>
wrote:
> Trans wrote:
> > The toplevel object (aka 'main') delegates some module-equivalent
> > methods to Object class.
>
> As far as I'm aware it "delegates" only alias, undef, def, module and cla=
ss.
> So it only delegates keywords, not methods. Which is, I assume, why def w=
orks
> and define_method (which is a method) does not.
Good point. I never really looked at like that b/c I tend to think of
keywords as syntax sugar for real methods.
class -> Class.new
def -> define_method
alias -> alias_method
etc.
Conditionals are an exception, of course.
But it sort of begs the question, why does it support the one and not
the other?
T.