From: transfire@... Date: 2006-07-14T22:05:13+09:00 Subject: Re: About MyClass#my_method Jonas Pfenniger wrote: > Yes but Matz said to optimize breakage for 2.0 so this might be worthwile. > I remember that lisp guy saying that ruby methods where not > first-class methods (didn't find the thread). Which is wrong, but such > shortcuts are nice for metaprogramming. I would be even better if they retained state too. > > > def MyClass#my_method end would replace class MyClass; def my_method end end > > > > This is already done: > > > > def MyClass.my_method > > ... > > No, this is a class method. You have to use > MyClass.define_method(:my_method) {} to define a new instance method. Ah, my bad. I misread. Yea, I agree. It would be nice. > > I would search the mailing list though, this has been mentioned before. > > I've tried but nothing really nice went out. Do you have and nice > keywords I could use ? Hmm. Yea that's a hard one to search for. I did find this, bt itn;t much: http://groups.google.com/group/comp.lang.ruby/browse_thread/thread/a5c87a9472c642ce/97c5ede426c1c111?q=%22%23%22+instance+method+ri&rnum=6#97c5ede426c1c111 T.