Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Eliminate redundant loads of linenoise when setting it up
  • Loading branch information
hoelzro committed Mar 24, 2015
1 parent 886d00b commit 3e3b22e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Perl6/Compiler.nqp
Expand Up @@ -99,10 +99,11 @@ class Perl6::Compiler is HLL::Compiler {

method interactive(*@args, *%adverbs) {
try {
$!linenoise := self.eval("use Linenoise; &linenoise");
$!linenoise_add_history := self.eval("use Linenoise; &linenoiseHistoryAdd");
my @symbols := self.eval("use Linenoise; nqp::list(&linenoise, &linenoiseHistoryAdd, &linenoiseSetCompletionCallback)");

my $linenoise_set_completion_callback := self.eval("use Linenoise; &linenoiseSetCompletionCallback");
$!linenoise := @symbols[0];
$!linenoise_add_history := @symbols[1];
my $linenoise_set_completion_callback := @symbols[2];

$linenoise_set_completion_callback(self.eval('use Completion; use Linenoise; -> Str $line, Linenoise::Completions $c {
for complete($line, $line.chars - 1) -> $completion {
Expand Down

0 comments on commit 3e3b22e

Please sign in to comment.