Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Clarifies say in Mu, closes #2619
  • Loading branch information
JJ committed Feb 11, 2019
1 parent c46235e commit bb92b0d
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions doc/Type/Mu.pod6
Expand Up @@ -425,20 +425,27 @@ stringifying non-C<Str> object using the C<.Str> method.
=head2 method say
multi method say(--> Bool:D)
multi method say()
Will L<C<say>|/type/IO::Handle#method_say> to
L<standard output|/language/variables#index-entry-$*OUT>.
To produce machine readable output use C<.put> instead.
say 42; # OUTPUT: «42␤»
What C<say> actually does is, thus, deferred to the actual subclass. In <most
cases|/routine/say> it calls L<C<.gist>|/routine/gist> on the object, returning
a compact string representation.
In non-sink context, C<say> will always return C<True>.
say (1,[1,2],"foo",Mu).map: so *.say ;# OUTPUT: «1␤[1 2]␤foo␤(Mu)␤(True True True True)␤»
say (1,[1,2],"foo",Mu).map: so *.say ;
# OUTPUT: «1␤[1 2]␤foo␤(Mu)␤(True True True True)␤»
However, this behavior is just conventional and you shouldn't trust on it for
your code. It's useful, however, to explain certain behaviors.
C<say> is first printing out, but the outermost C<say> is printing the C<True>
values returned by the C<so> operation.
C<say> is first printing out in C<*.say>, but the outermost C<say> is printing
the C<True> values returned by the C<so> operation.
=head2 method ACCEPTS
Expand Down

0 comments on commit bb92b0d

Please sign in to comment.