Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

s/end/finish/ in order to avoid name clash with Any

  • Loading branch information...
commit afbf20d6cf066c1e3cc8203041950addd4022ce7 1 parent 14007bc
@ruoso authored
View
6 example.pl
@@ -17,7 +17,7 @@
:base('/'),
:begin-closure({ say "root - begin" }),
:execute-closure({ say "root - execute " }),
- :end-closure({ say "root - end" }) );
+ :finish-closure({ say "root - finish" }) );
$app.register-action($root);
my $blog = Faz::Action::Chained.new( :parent($root),
@@ -26,7 +26,7 @@
:regex(/ blog\/(\w+)\/ /),
:begin-closure(-> $name { say "blog $name - begin " }),
:execute-closure(-> $name { say "blog $name - execute " }),
- :end-closure(-> $name { say "blog $name - end" }) );
+ :finish-closure(-> $name { say "blog $name - finish" }) );
$app.register-action($blog);
my $viewblog = Faz::Action::Public.new( :parent($blog),
@@ -35,7 +35,7 @@
:regex(/ (\w+) \/? /),
:begin-closure( -> $name { say "viewblog $name - begin" }),
:execute-closure( -> $name { say "viewblog $name - execute" }),
- :end-closure(-> $name { say "viewblog $name - end" }) );
+ :finish-closure(-> $name { say "viewblog $name - finish" }) );
$app.register-action($viewblog);
my $uri = Faz::URI.new(:path('/blog/faz/bla'));
View
10 lib/Faz/Action/Chained.pm
@@ -5,7 +5,7 @@ class Faz::Action::Chained does Faz::Action {
has Callable $.begin-closure;
has Callable $.execute-closure;
- has Callable $.end-closure;
+ has Callable $.finish-closure;
multi method begin(*@p, :$parent_action_capture, *%n) {
if $.parent {
@@ -39,9 +39,9 @@ class Faz::Action::Chained does Faz::Action {
}
}
- multi method end(*@p, :$parent_action_capture, *%n) {
- if $.end-closure {
- $.end-closure.(|@p, |%n)
+ multi method finish(*@p, :$parent_action_capture, *%n) {
+ if $.finish-closure {
+ $.finish-closure.(|@p, |%n)
}
if $.parent {
my %named;
@@ -51,7 +51,7 @@ class Faz::Action::Chained does Faz::Action {
@pos := @($parent_action_capture<action_capture>);
%named<parent_action_capture> = $parent_action_capture<parent_action_capture>;
}
- $.parent.*end(|%named, |@pos);
+ $.parent.*finish(|%named, |@pos);
}
}
}
View
16 lib/Faz/Action/Private.pm
@@ -1,17 +1,17 @@
class Faz::Action::Private does Faz::Action {
has Callable $.begin-closure;
has Callable $.execute-closure;
- has Callable $.end-closure;
- multi method begin {
- $.begin-closure.(self)
+ has Callable $.finish-closure;
+ multi method begin(*@p, *%n) {
+ $.begin-closure.(|@p, |%n)
if $.begin-closure;
}
- multi method execute(*@_, *%_) {
- $.execute-closure.(self, |@_, |%_)
+ multi method execute(*@p, *%n) {
+ $.execute-closure.(|@p, |%n)
if $.execute-closure;
}
- multi method end {
- $.end-closure.(self)
- if $.end-closure;
+ multi method finish(*@p, *%n) {
+ $.finish-closure.(@p, %n)
+ if $.finish-closure;
}
}
View
2  lib/Faz/Dispatcher.pm
@@ -79,7 +79,7 @@ role Faz::Dispatcher {
$errors = $! if $!;
}
}
- $action.*end(|@pos, |%named);
+ $action.*finish(|@pos, |%named);
# we don't know how to handle control exceptions yet.
# CONTROL {
# when Faz::ControlExceptionDetach {
Please sign in to comment.
Something went wrong with that request. Please try again.