ara.t.howard / noaa.gov wrote:
> On Thu, 28 Dec 2006, Pit Capitain wrote:
>
> > ara.t.howard / noaa.gov schrieb:
> >> mine is slowest of all, however it preserves blocks: see if you can speed
> >> it up (...)
> >
> > Ara, maybe your implementation is slow, but at least you are too fast for me
> > :-) I just wanted to start a new thread asking for alternative techniques...
> >
> > Your implementation has the syntatical advantage that you can call the
> > previous implementation with the super keyword.
>
> heh - i'm working on making it stack based attm so one can do
>
>    push_method 'foo' do
>      'the new foo' or super  # super works!
>    end
>
> and, later
>
>    pop_method 'foo' # restore super

I've ssen a stack used before (but I can't recall where, was it Nitro's
aspect.rb?) Your syntax though is an interesting method-ology ;-)

Hmm....

  defs.push 'foo' do
    ...
  end

  defs.pop

T.