Documentation for routine
printf assembled from the following types:
multi method printf(|)
multi method printf(IO::Handle: Cool , *)
Formats a string based on the given format and arguments and
Attempting to call this method when the handle is in binary mode will result in
X::IO::BinaryMode exception being thrown.
my = open 'path/to/file', :w;.printf: "The value is %d\n", 32;.close;
From Independent routines
method printf (*)multi sub printf(Cool , *)
As a method, takes the object as a format using the same language as
Str.sprintf; as a sub, its first argument will be the format string, and the rest of the arguments will be substituted in the format following the format conventions.
"%s is %s".printf("þor", "mighty"); # OUTPUT: «þor is mighty»printf( "%s is %s", "þor", "mighty"); # OUTPUT: «þor is mighty»
Junctions, it will also autothread, without a guaranteed order.
printf( "%.2f ", ⅓ | ¼ | ¾ ); # OUTPUT: «0.33 0.25 0.75 »