On Aug 28, 2005, at 5:52 AM, Yuval Kogman wrote:

On Sun, Aug 28, 2005 at 05:18:42 -0400, David Storrs wrote:
On Aug 28, 2005, at 5:12 AM, Yuval Kogman wrote:
On Sun, Aug 28, 2005 at 05:02:25 -0400, David Storrs wrote:

nested_call.wrap(), maybe?

It's not 100% the same thing... Wrapping is for wrapping only. This
applies to super methods, delegate methods, and so forth.

If I understand the semantics of wrap() properly, I believe you can do everything with wrap that you want. I agree it's not the optimal way though...for one
thing, you have to write the code inside out.

Not without breaking polymorphism, or doing creepy things like:

    our &method = $?CLASS.can("method").wrap {
        ...
        call
        ...
    };

instead of

    method method {
        $?SELF.SUPER::method; # what's the syntax for this, btw?
        # Can't find it under s12
    }

Hey, I said you /could/ do it, not that you /should/ or that it was the best way. :>

Actually, I agreed it wasn't, I was just throwing it out there as a starting point.


On the other hand, one thing i'd like to borrow is the ability to
use 'call' for "delegating" subroutines:

    sub foo will call(&other) {
        call; # just like saying other()
    }

Seconded. Although it starts to get interesting when you want to pass in multiple &other()s.

--Dks

Reply via email to