Skip to content

Instantly share code, notes, and snippets.

@lizmat
Created May 14, 2020 20:51
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 lizmat/943e0da61d84cff6a61ab8d159729594 to your computer and use it in GitHub Desktop.
Save lizmat/943e0da61d84cff6a61ab8d159729594 to your computer and use it in GitHub Desktop.
What's wrong with these candidates?
proto sub slurp(|) {*}
multi sub slurp(*%_) { $*ARGFILES.slurp(|%_) }
multi sub slurp(IO::Handle:D $fh, *%_) { $fh.slurp(|%_) }
multi sub slurp(IO() $path, *%_) { $path.slurp(|%_) }
proto sub spurt($, $, |) {*}
multi sub spurt(IO::Handle:D $fh, $data, *%_) { $fh.spurt($data, |%_) }
multi sub spurt(IO() $path, $data, *%_) { $path.spurt($data, |%_) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment