Skip to content

Instantly share code, notes, and snippets.

@Tux
Created December 4, 2015 16:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tux/f614aa3e7cfc159a0a74 to your computer and use it in GitHub Desktop.
Save Tux/f614aa3e7cfc159a0a74 to your computer and use it in GitHub Desktop.
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