[Nitro] Aspects

Trans transfire at gmail.com
Fri Aug 31 20:15:49 EDT 2007



On Aug 31, 9:40 am, "George Moschovitis"
<george.moschovi... at gmail.com> wrote:
> >   around :x do |target, *args|
> >     ...
> >     target.super
> >     ...
> >   end
>
> I don't find this too ugly. As long as the performance is "right". It seems
> to be faster than the 'non-target' version.
> W/o source code I cannot offer further  advices (no pun intended).

I wish there was another way, but I can't seem to find one, so I just
went ahead with the target solution. What irks me about it though is
1) it's not compatible with Matz version, 2) one starts to expect
target to offer more meta-information, like method name, arity,
__LINE__, binding, etc. and 3) then you think before and after advice
should passed the target object too. That's why I say it makes more
sense for a full-blown AOP deal, but not so much for a light-weight
advice solution. Well, Maybe I'll give in and just supply a full-blown
taget to all of them. In the mean time here the solution as it
currently stands (I'll attach it my next post).

T.



More information about the Nitro-general mailing list