Created
December 4, 2015 16:02
-
-
Save Tux/f614aa3e7cfc159a0a74 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
class IO::String is IO::Handle { | |
has @!content; | |
multi method new (Str $str!) { | |
self.bless.print ($str); | |
} | |
method print (*@what) { | |
@!content.push: @what.join (""); | |
} | |
method print-nl { | |
self.print ($.nl); | |
} | |
method Str { | |
@!content.join (""); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment