Created
May 21, 2014 14:42
-
-
Save jnthn/cd062dfa6bccf8f95e2d to your computer and use it in GitHub Desktop.
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
diff --git a/src/core/IO.pm b/src/core/IO.pm | |
index 5067ef5..8039ca7 100644 | |
--- a/src/core/IO.pm | |
+++ b/src/core/IO.pm | |
@@ -6,10 +6,15 @@ sub print(|) { | |
Bool::True | |
} | |
-sub say(|) { | |
+proto sub say(|) { * } | |
+multi sub say(\x) { | |
+ $*OUT.say(x); | |
+} | |
+multi sub say(|) { | |
my $args := nqp::p6argvmarray(); | |
- $*OUT.print(nqp::shift($args).gist) while $args; | |
- $*OUT.print("\n"); | |
+ my $out := $*OUT; | |
+ $out.print(nqp::shift($args).gist) while $args; | |
+ $out.print("\n"); | |
} | |
sub note(|) { | |
@@ -265,11 +270,15 @@ my class IO::Handle does IO::FileTestable { | |
Bool::True | |
} | |
+ multi method say(IO::Handle:D: \x) { | |
+ nqp::sayfh($!PIO, x.gist); | |
+ } | |
+ | |
multi method say(IO::Handle:D: |) { | |
my Mu $args := nqp::p6argvmarray(); | |
nqp::shift($args); | |
- self.print: nqp::shift($args).gist while $args; | |
- self.print: "\n"; | |
+ nqp::printfh($!PIO, nqp::shift($args).gist) while $args; | |
+ nqp::printfh($!PIO, "\n"); | |
} | |
method slurp(:$bin, :enc($encoding)) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment