From: "Mauricio Fernández" Date: 2004-01-25T23:02:36+09:00 Subject: Re: determine method passed and determine the receiver that received the method On Sun, Jan 25, 2004 at 10:14:56PM +0900, Robert Klemme wrote: > > "Mauricio Fern�ndez" schrieb im Newsbeitrag > news:20040124235621.GA7427@student.ei.uni-stuttgart.de... > > On Sun, Jan 25, 2004 at 05:04:58AM +0900, Robert Klemme wrote: > > > Cancel that. This works: > > > > > > class Module > > > def notify(sym) > > > new_sym = "#{sym}_old".intern > > > alias_method new_sym.to_s, sym.to_s > > > > > > define_method sym do |*args| > > > > Isn't it a shame that you cannot propagate blocks with define_method? > > Yeah, that's true. I ran into it while figuring how to do it. What would you think about Kernel::block_given, returning a Proc corresponding to the block or nil? In the current situation you have to choose between having a closure and propagating the block :-P -- _ _ | |__ __ _| |_ ___ _ __ ___ __ _ _ __ | '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \ | |_) | (_| | |_\__ \ | | | | | (_| | | | | |_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_| Running Debian GNU/Linux Sid (unstable) batsman dot geo at yahoo dot com * liw prefers not to have Linus run Debian, because then /me would have to run Red Hat, just to keep the power balance :) -- #Debian