From: Jeff Mitchell Date: 2004-04-29T13:18:38+09:00 Subject: Re: alias or alias_method problem --- Kristof Bastiaensen wrote: > Hi, > > On Thu, 29 Apr 2004 08:36:03 +0900, Angel Martin wrote: > > > alias_method "_[]=","[]=" > > alias_method "_[]" ,"[]" > > I guess renaming to something with "[]" in the name > will not work, (due to the way Ruby compiles expressions). > > > _[*ag]=value > > Will try to evaluate _, and then calls []= on the result. > (It seems that _ evaluates to nil inside irb, > I don't understand why...) 99% of the time alias_method is used in conjunction with redefining a method. The above issues would have been avoided if ruby had something like, redef foo(*args) puts "new foo" previous(*args) # calls old foo end __________________________________ Do you Yahoo!? Win a $20,000 Career Makeover at Yahoo! HotJobs http://hotjobs.sweepstakes.yahoo.com/careermakeover