From: Robert Feldt Date: 2001-03-06T13:12:09+09:00 Subject: [ruby-talk:12086] Re: Ruby & AOP On Tue, 6 Mar 2001, Avi Bryant wrote: > > I like the idea, it's easy to implement, but performance would be an obstacle. > > Matz, > > what about allowing it to be enabled on a method-by-method basis? > i.e., > > trap_calls :method > > That way the performance hit would only be for those methods it was needed > for. > > To have this functionality supported at the interpreter level would be > *great*. > I agree (I guess problem is to find a bit to indicate this. Idea to avoid this: have trap_calls introduce new nodes in the body (first and last I guess) of the method to be trapped => no other stuff needed? Well we have to retain the node when method redefined but anyway...). Maybe change name of callback to 'on_trapped_call' and add 'on_trapped_return'? /Robert