Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add aritiy-1 infix:<~> for Blobs
Constructs like [~] @array-of-blobs currently fail when there's only one element
in the list, as in such cases infix:<~>(Str) is used.

Fix by adding arity-1 infix:<~>(Blob:D) that simply returns its argument
  • Loading branch information
zoffixznet committed Nov 25, 2016
1 parent fce1a24 commit 77e9d4b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/core/Buf.pm
Expand Up @@ -666,6 +666,7 @@ multi sub pack(@template, *@items) {
return Buf.new(@bytes);
}

multi sub infix:<~>(Blob:D \a) { a }
multi sub infix:<~>(Blob:D $a, Blob:D $b) {
my $res := ($a.WHAT === $b.WHAT ?? $a !! Buf).new;
my $adc := nqp::decont($a);
Expand Down

0 comments on commit 77e9d4b

Please sign in to comment.