Skip to content

Commit

Permalink
1-arity ~ for blobs #2632
Browse files Browse the repository at this point in the history
Also, same on Junctions...
  • Loading branch information
JJ committed May 5, 2020
1 parent 56bd8dd commit a580e45
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions doc/Language/operators.pod6
Expand Up @@ -1501,6 +1501,7 @@ L<assignment|/language/operators#Assignment_operators>, for instance.
multi sub infix:<~>(Str:D, Str:D)
multi sub infix:<~>(Buf:D, Buf:D)
multi sub infix:<~>(Blob:D $a, Blob:D $b)
multi sub infix:<~>(Junction:D \a, Junction:D \b)
This is the X<string concatenation operator>, which coerces both
arguments to L<Str|/type/Str> and concatenates them. If both arguments
Expand All @@ -1512,6 +1513,13 @@ my $bob = Blob.new([1,2,3]);
my $bao = Blob.new([3,4,5]);
say $bao ~ $bob; # OUTPUT: «Blob:0x<03 04 05 01 02 03>␤»
The arity-1 version of this operator will be called when the hyper version of
the operator is used on an array or list with a single element, or simply an
element
=for code
say [~] Blob.new([3,4,5]); # OUTPUT: «Blob:0x<03 04 05>␤»
say [~] 1|2; # OUTPUT: «any(1, 2)␤»
=head2 infix C«»
Expand Down

0 comments on commit a580e45

Please sign in to comment.