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
#!/usr/bin/perl6 | |
use nqp; | |
class MyREPL is REPL { | |
# Simplified copy-paste of one iteration of repl-loop | |
method eval-in-ctx($code, *%adverbs) { | |
my $*CTXSAVE := self; | |
my $*MAIN_CTX; |
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
unit package Debug::REPLHere; | |
use nqp; | |
our sub repl-here($context=Nil) is export { | |
my $comp = nqp::getcomp('perl6'); | |
my $repl = REPL.new($comp, {}); | |
my $nqpctx := nqp::getattr(nqp::decont($context // CALLER::), PseudoStash, '$!ctx'); | |
$repl.^attributes.first('$!save_ctx').set_value($repl, $nqpctx); | |
$repl.repl-loop; |