Documentation for routine
put assembled from the following types:
multi method put(--> Bool)
Prints value to
$*OUT, adding a newline at end, and if necessary, stringifying non-
Str object using the
"abc".put; # RESULT: «abc␤»
multi sub put(** --> True)multi sub put(Junction --> True)
put "Hi there!\n"; # OUTPUT: «Hi there!␤␤»put "Hi there!"; # OUTPUT: «Hi there!␤»put [1, 2, 3]; # OUTPUT: «1 2 3␤»
multi method put(** --> True)multi method put(Junction --> True)
Writes the given
@text to the handle, coercing any non-Str objects to Str by calling
.Str method on them, and appending the value of
.nl-out at the end. Junction arguments autothread and the order of printed strings is not guaranteed.
Attempting to call this method when the handle is in binary mode will result in
X::IO::BinaryMode exception being thrown.
my = 'path/to/file'.IO.open: :w;.put: 'some text';.close;
multi method put(|)
method put(IO::Socket: Str(Cool) )
Writes the supplied string, with a
\n appended to it, to the socket, thus sending it to other end of the connection.
Fails if the socket is not connected.