Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Deprecate Socket.send in favor of Socket.print
Users may confuse the send method (which is just a Str-friendly wrapper
over write) with send(2), which is subtly different from write(2).  To
avoid this confusion, and open up the possibility of a true send(2)
analogue in the future, I think that the current send should be renamed
to print (thanks to jnthn++ for the suggestion)
  • Loading branch information
hoelzro committed Jul 29, 2015
1 parent 646b90f commit 7bda3db
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/core/IO/Socket.pm
Expand Up @@ -66,7 +66,12 @@ my role IO::Socket does IO {
die 'Socket.poll is NYI'
}

method send (Str(Cool) $string) {
method send(|c) {
DEPRECATED('print', |<2015.07 2015.09>);
self.print(|c)
}

method print (Str(Cool) $string) {
fail("Not connected") unless $!PIO;
nqp::printfh($!PIO, nqp::unbox_s($string));
True
Expand Down

0 comments on commit 7bda3db

Please sign in to comment.