Re: How do you say another_sub(@_) in perl 6?

2005-08-28 Thread David Storrs


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


Re: How do you say another_sub(@_) in perl 6?

2005-08-28 Thread Yuval Kogman
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
}

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()
}

-- 
 ()  Yuval Kogman [EMAIL PROTECTED] 0xEBD27418  perl hacker 
 /\  kung foo master: /me kicks %s on the nose: neeyah!



pgpgk8s0nYZ8S.pgp
Description: PGP signature


Re: How do you say another_sub(@_) in perl 6?

2005-08-28 Thread Yuval Kogman
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.

-- 
 ()  Yuval Kogman [EMAIL PROTECTED] 0xEBD27418  perl hacker 
 /\  kung foo master: /me climbs a brick wall with his fingers: neeyah!



pgpDOgTN4egzn.pgp
Description: PGP signature


Re: How do you say another_sub(@_) in perl 6?

2005-08-28 Thread David Storrs


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



oops... Can I forward our correspondence to the mailing list?



Sure.  I was wondering why you took it private.  :

--Dks