Skip to content

Commit

Permalink
Enable &say and &print to be able to accept an argument list instead …
Browse files Browse the repository at this point in the history
…of single arguments.
  • Loading branch information
pmichaud committed Jun 9, 2011
1 parent e1b2a77 commit fb4a373
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions src/CORE.setting/IO.pm
@@ -1,10 +1,29 @@
# XXX Very cheaty, just to get us able to output something.
sub say(Mu $value) {
pir::say__vS(pir::repr_unbox_str__SP($value.Str));
sub say(|$) {
Q:PIR {
$P0 = perl6_current_args_rpa
$P1 = iter $P0
loop:
unless $P1 goto done
$P2 = shift $P1
print $P2
goto loop
done:
print "\n"
};
1.Bool
}

sub print(Mu $value) {
pir::print__vS(pir::repr_unbox_str__SP($value.Str));
sub print(|$) {
Q:PIR {
$P0 = perl6_current_args_rpa
$P1 = iter $P0
loop:
unless $P1 goto done
$P2 = shift $P1
print $P2
goto loop
done:
};
1.Bool
}

0 comments on commit fb4a373

Please sign in to comment.