Skip to content
Browse files

rakudo implements the $*foo syntax as globals... so lets workaround t…

…he lack of contextual vars by using globals
  • Loading branch information...
1 parent 1f67a07 commit 0536e7774cd49f381cf418eb77cc84746211ac13 @ruoso committed
Showing with 5 additions and 3 deletions.
  1. +4 −0 lib/Faz/Application.pm
  2. +1 −3 lib/Faz/Dispatcher.pm
View
4 lib/Faz/Application.pm
@@ -11,6 +11,10 @@ role Faz::Application {
multi method handle($request? is context = $*request,
$response? is context = $*response) {
my $application is context = self;
+ # TODO: context vars are still globals in rakudo...
+ $*application = self;
+ $*request = $request;
+ $*response = $response;
self.*prepare;
self.*dispatch;
self.*finalize;
View
4 lib/Faz/Dispatcher.pm
@@ -56,9 +56,7 @@ role Faz::Dispatcher {
method dispatch() {
self.compile;
-# TODO: rakudo does not support contextual variables yet
-# if $*request.uri.path ~~ $!regex {
- if '/blog/faz/bla' ~~ $!regex {
+ if $*request.uri.path ~~ $!regex {
my %named = %($<subrx><action_capture>);
my @pos = @($<subrx><action_capture>);
%named<parent_action_capture> = $<subrx><parent_action_capture>;

0 comments on commit 0536e77

Please sign in to comment.
Something went wrong with that request. Please try again.