From: dblack@... Date: 2006-07-14T20:23:52+09:00 Subject: Re: About MyClass#my_method Hi -- On Fri, 14 Jul 2006, Jonas Pfenniger wrote: > Hi, > > I always see the # notation in the docs to design instance_methods. > Wouldn't it be nice to be able to use that notation to address and > access methods directly ? > > MyClass#my_method would replace MyClass.instance_method(:my_method) > > and > > def MyClass#my_method end would replace class MyClass; def my_method end end That syntax is already taken, for comments. > Similarily, I was also thinking that :: could be used for class methods. I'd be glad to see :: for method *calls* disappear, but I doubt it will and therefore it's not available. Also, both method names and constants can start with uppercase letters, which I think would make parsing this impossible. David -- http://www.rubypowerandlight.com => Ruby/Rails training & consultancy http://www.manning.com/black => RUBY FOR RAILS (reviewed on Slashdot, 7/12/2006!) http://dablog.rubypal.com => D[avid ]A[. ]B[lack's][ Web]log dblack@wobblini.net => me