From: Daniel Schierbeck Date: 2005-12-20T04:17:47+09:00 Subject: Re: shortcut to self.class ? gabriele renzi wrote: > Daniel Schierbeck ha scritto: >> Mark J. Reed wrote: >> >>> Without writing my own alias, is there an easy way to get the class of >>> the current object without calling self.class? I'm trying to call class >>> methods from within an instance method, and self.class.method_name is >>> just a little verbose for my taste. I could do type.method_name, but >>> that's deprecated and not very clear. It would be nice if just class >>> by itself were understood in context as the method instead of the >>> keyword, >>> but since it's not, I'm sort of stuck. Suggestions? >> >> >> I think it's a good idea to allow `class' to be called from within >> methods if there's a dot after it >> >> class.some_method # legal >> class # illegal, or rather, creates a new class > > +1, but I wonder if this may be a limitation of the parser Probably. I'm getting a bit fed up with the current parser, it seems to kill off a lot of good ideas. What's the status on that new ANTLR grammar? Cheers, Daniel