Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable &say and &print to be able to accept an argument list instead …
…of single arguments.
- Loading branch information
Showing
1 changed file
with
23 additions
and
4 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} |