Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Removes skip-test
  • Loading branch information
JJ committed Sep 27, 2018
1 parent 1d906f1 commit 942dd69
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions doc/Type/Cool.pod6
Expand Up @@ -1442,10 +1442,12 @@ And also the current language, meaning any added syntax is available:
An C<EVAL> statement evaluates to the result of the last statement:
sub infix:<mean>(*@a) is assoc<list> {
@a.sum / @a.elems
}
say EVAL 'say 1; 2 mean 6 mean 4'; # OUTPUT: «1␤4␤»
=begin code
sub infix:<mean>(*@a) is assoc<list> {
@a.sum / @a.elems
}
say EVAL 'say 1; 2 mean 6 mean 4'; # OUTPUT: «1␤4␤»
=end code
C<EVAL> is also a gateway for executing code in other languages:
Expand Down Expand Up @@ -1496,14 +1498,23 @@ 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»
=head2 routine sprintf
Defined as:
=begin comment
method sprintf(*@args)
multi sub sprintf(Cool:D $format, *@args)
Formats and outputs a string, following the
L<the same language as C<Str.sprintf>|/type/Str#routine_sprintf>, using as such
format either the object (if called in method form) or the first argument (if
called as a routine)
TODO:
sprintf
sprintf( "%s the %d%s", "þor", 1, "st").put; #OUTPUT: «þor the 1st␤»
sprintf( "%s is %s", "þor", "mighty").put; # OUTPUT: «þor is mighty␤»
"%s's weight is %.2f %s".sprintf( "Mjölnir", 3.3392, "kg").put;
# OUTPUT: «Mjölnir's weight is 3.34 kg␤»
=end comment
=end pod

Expand Down

0 comments on commit 942dd69

Please sign in to comment.