"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/core.c/set_multiply.pm6" between
rakudo-2020.09.tar.gz and rakudo-2020.10.tar.gz

About: Rakudo is a compiler for the Raku Pogramming Language (formerly known as Perl 6).

set_multiply.pm6  (rakudo-2020.09):set_multiply.pm6  (rakudo-2020.10)
# This file implements the following set operators: # This file implements the following set operators:
# (.) set multiplication (ASCII) # (.) set multiplication (ASCII)
# ⊍ set multiplication # ⊍ set multiplication
proto sub infix:<(.)>(|) is pure {*} proto sub infix:<(.)>(|) is pure {*}
multi sub infix:<(.)>() { bag() } multi sub infix:<(.)>() { bag() }
multi sub infix:<(.)>(Setty:D \a) { a.Baggy } multi sub infix:<(.)>(Setty:D \a) { a.Baggy }
multi sub infix:<(.)>(Baggy:D \a) { a } # also Mixy multi sub infix:<(.)>(Baggy:D \a) { a } # also Mixy
multi sub infix:<(.)>(Any \a) { a.Bag }
multi sub infix:<(.)>(Setty:D \a, Setty:D \b) { multi sub infix:<(.)>(Setty:D \a, Setty:D \b) {
nqp::if( nqp::if(
(my $elems := a.Bag.RAW-HASH) && nqp::elems($elems), (my $elems := a.Bag.RAW-HASH) && nqp::elems($elems),
nqp::create(a.WHAT.Baggy).SET-SELF( nqp::create(a.WHAT.Baggy).SET-SELF(
Rakudo::QuantHash.MULTIPLY-SET-TO-BAG($elems,b.RAW-HASH), Rakudo::QuantHash.MULTIPLY-SET-TO-BAG($elems,b.RAW-HASH),
), ),
a.Baggy a.Baggy
) )
} }
skipping to change at line 66 skipping to change at line 65
infix:<(.)>( infix:<(.)>(
nqp::isconcrete(a) nqp::isconcrete(a)
?? nqp::istype(a,Setty) ?? nqp::istype(a,Setty)
?? a.Baggy ?? a.Baggy
!! nqp::istype(a,Baggy) ?? a !! a.Bag !! nqp::istype(a,Baggy) ?? a !! a.Bag
!! a.Bag, !! a.Bag,
b.Bag b.Bag
) )
} }
multi sub infix:<(.)>(**@p) { multi sub infix:<(.)>(+@p) { # also Any
my $result = @p.shift; my $result := @p.shift;
$result = $result (.) @p.shift while @p; if @p {
$result $result := $result (.) @p.shift while @p;
$result
}
else {
$result.Bag
}
} }
# U+228D MULTISET MULTIPLICATION # U+228D MULTISET MULTIPLICATION
my constant &infix:<⊍> := &infix:<(.)>; my constant &infix:<⊍> := &infix:<(.)>;
# vim: expandtab shiftwidth=4 # vim: expandtab shiftwidth=4
 End of changes. 2 change blocks. 
5 lines changed or deleted 9 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)