Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Tentatively implement "samewith" for calling same method with differe…
…nt params

This is essentially syntactic sugar for &?ROUTINE.dispatcher()( self, @params );
  • Loading branch information
lizmat committed Aug 7, 2013
1 parent 9117969 commit 1d15f4d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/core/control.pm
Expand Up @@ -118,6 +118,15 @@ my &lastcall := -> {
True
};

my &samewith := -> *@pos, *%named {
my $caller = callframe(1);
my $self = $caller.my<self>
|| die "Could not find 'self'";
my $dispatcher = $caller.my<&?ROUTINE>.dispatcher
|| die "Could not find dispatcher";
$dispatcher( $self, |@pos, |%named );
}

proto sub die(|) is hidden_from_backtrace {*};
multi sub die(Exception $e) is hidden_from_backtrace { $e.throw }
multi sub die($payload) is hidden_from_backtrace {
Expand Down

0 comments on commit 1d15f4d

Please sign in to comment.