From: "T. Onoma" Date: 2003-12-01T12:18:48+09:00 Subject: Re: Underpinnings of Method Wrapping On Monday 01 December 2003 12:25 am, Peter wrote: > > 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... Sorry, source of confusion: I used 'wrap' here to mean a combined pre and post. (Mentally, I'm still repeating def for an intrinsic wraps). Perhaps better terms are: inner wrap and outer wrap? So with the above I was pointing out that we could just have a separate keyword for outer wrap definitions. > 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. You're a man after my own heart! :-) I don't know if you noticed the research notes at the bottom of the RCR, but this is essentially one of the notations I was playing with and very much liked. Perfect for outer wraps. And pdef actually works pretty well too, once you think about it for a sec. Short and to the point. > > 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. That would be great, I have some other work to do too. So afterward, I take it you want to collaborate on a finalized joint RCR on the matter? That would be excellent. And yes, some good examples are quite important. > > 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? I think so. Could you clearify these two different syntaxes and where they apply, so that I can be sure that I'm understanding you correctly? -t0