Skip to content

Commit

Permalink
Check input for definedness instead of passing everything to &val and…
Browse files Browse the repository at this point in the history
… muting potential warnings.
  • Loading branch information
jkramer committed Jul 4, 2018
1 parent 0275ea2 commit 07b032d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/io_operators.pm6
Expand Up @@ -63,13 +63,13 @@ multi sub gist(|) {

proto sub prompt($?, *%) {*}
multi sub prompt() {
quietly val $*IN.get
nqp::defined(my \res := $*IN.get) ?? val(res) !! res;
}
multi sub prompt($msg) {
my $out := $*OUT;
$out.print($msg);
$out.flush();
quietly val $*IN.get;
nqp::defined(my \res := $*IN.get) ?? val(res) !! res;
}

proto sub dir(|) {*}
Expand Down

0 comments on commit 07b032d

Please sign in to comment.