From: "Mauricio Fernández" Date: 2004-04-20T18:14:25+09:00 Subject: Re: proposal: call_up() for use in redefined methods On Tue, Apr 20, 2004 at 08:04:54AM +0900, Hal Fulton wrote: > Mark Hubbart wrote: > > [snip] > > > > >Comments? Questions? Flames? :) > > > > I think this is essentially the same as my suggestion in > http://ruby-talk.org/38136 It seems nobody saw this posting of mine: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/97440 That code allows you to do class A def foo(*a) puts "A#foo #{a.inspect}" end end a = A.new a.foo class A def_advice(:foo) do |prior, *a| puts "before" prior[*a] puts "after" end end a.foo i.e. the previous definition is available as prior (or whatever name you care to give it :). The most important drawback is that it is still impossible to propagate blocks that way (until matz implements {|&block|...}). > The answer then was basically: Something like this will come > later. > > In fact, I believe that Matz's plans for pre/post/wrap would make > this sort of thing easy (and far more generalized). matz' advices will be more powerful, see the references in [97440] for more info. -- Running Debian GNU/Linux Sid (unstable) batsman dot geo at yahoo dot com 'Ooohh.. "FreeBSD is faster over loopback, when compared to Linux over the wire". Film at 11.' -- Linus Torvalds