From: Peter Date: 2003-12-01T08:25:01+09:00 Subject: Re: Underpinnings of Method Wrapping > You're absolutely right. Hmm...Granted this is acting in accordance to an > intrinsic wrap, buit it's not gaurenteed. So this is fine, but if foo is > later redefined this wrap will be flushed (at least IMHO it should be). But > we need to solve the problem you present., so either pre and post must be > considered essentially connected in scope with access to the same vars, which > seems rather odd, or we can just have an intrinstic wrap defintion like: > > wrap foo(*args) > # set a here, do other stuff not affecting the super call > result = psudeo_super > # use a here, do other stuff not affecting the result > end > > Then we don't need pre or post. I suppose if no "psuedo_super" is given it > would be assumed to be like a pre? I'm not sure. What do you think? First a note: I think intrinsic and extrinsic got swapped between the first mention of it and now. Maybe we should try to get these things straight to avoid unnecessary misunderstandings. A wrap was intrinsic, because it was an intrinsic part of the semantics of a method, and pre and post were extrinsic because they were really just riding along quietly. That sounds logical to me. By this definition I assume above you meant extrinsic, right? We could also choose some other terms that are harder to mix up... Now for pseudo_super; it looks a bit weird, but I haven't got any better idea yet. I'm toying with something like this: pdef foo(*args) pre a = something # blah post print a # blah2 end end It's just that I want to get rid of the explicit call to super. > Your right. Sorry. But I do think sime of the same basic methods apply. Not > sure. I guess I need some examples to really be able to consider. I think if we want to get AOP to Ruby, it won't hurt to have examples showing what it can do. For starters, we could search the AspectJ site for examples and see what they look like in Ruby. But for the main dish we probably need examples of our own to show the Full Potential. But I'm looking at a busy week now, but after that I'll have some time to give it a serious try. > I think you're right on. My implementation, instead, just adds more of the > same: IMO, they both make sense. The existing version should use the redefinition syntax, your new version the wrapping syntax, agreed? Peter