Created
November 17, 2016 06:47
-
-
Save adaptiveoptics/3df583b4a14486923b1a6e66a0d4eb1f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use v6; | |
use MONKEY-SEE-NO-EVAL; | |
my $env = %*ENV; | |
class B { | |
method wrap(Callable $app) returns Callable { | |
my Callable $_app = $app; | |
return $_app; | |
} | |
} | |
class C { | |
method !mkapp() { | |
EVAL('sub app($env) { | |
return "I have output" | |
} | |
my $b = B.new; | |
$b.wrap(&app);'); | |
} | |
method run() { | |
my &app = self!mkapp; | |
return &app; | |
} | |
} | |
my $c = C.new; | |
while True {$c.run}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment