Skip to content

Commit

Permalink
Improves the documentation of .serial
Browse files Browse the repository at this point in the history
According to @lizmat comments in
https://stackoverflow.com/questions/56057931/what-does-serial-do and
@jnthn in the #1803 issue. I've finally opted for leaving it there, on
the premises that it might benefit no one if it disappears. I've added
all the necessary caveats. This closes #1803
  • Loading branch information
JJ committed May 10, 2019
1 parent 671eb50 commit 91b9f52
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions doc/Type/Any.pod6
Expand Up @@ -394,15 +394,24 @@ Defined as
multi method serial()
Returns the self-reference to the instance itself:
This method is Rakudo specific, and is not included in the Perl 6 spec.
The method returns the self-reference to the instance itself:
=begin code
my $b; # defaults to Any
my $b; # defaults to Any
say $b.serial.^name; # OUTPUT: «Any␤»
say $b.^name; # OUTPUT: «Any␤»
my $breakfast = 'food';
$breakfast.serial.say; # OUTPUT: «food␤»
=end code
This is apparently a no-op, as exemplified by the third example above. However,
in L<C<HyperSeq>|/type/HyperSeq>s and L<C<RaceSeq>|/type/RaceSeq>s it returns a
serialized C<Seq>, so it can be considered the opposite of the C<hyper/race>
methods. As such, it ensures that we are in serial list-processing mode, as
opposed to the autothreading mode of those methods.
=head2 method Hash
Defined as:
Expand Down

0 comments on commit 91b9f52

Please sign in to comment.