"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/core.c/set_difference.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_difference.pm6  (rakudo-2020.09):set_difference.pm6  (rakudo-2020.10)
# This file implements the following set operators: # This file implements the following set operators:
# (-) set difference (ASCII) # (-) set difference (ASCII)
# ∖ set difference # ∖ set difference
proto sub infix:<(-)>(|) is pure {*} proto sub infix:<(-)>(|) is pure {*}
multi sub infix:<(-)>() { set() } multi sub infix:<(-)>() { set() }
multi sub infix:<(-)>(QuantHash:D \a) { a } # Set/Bag/Mix multi sub infix:<(-)>(QuantHash:D \a) { a } # Set/Bag/Mix
multi sub infix:<(-)>(SetHash:D \a) { a.Set } multi sub infix:<(-)>(SetHash:D \a) { a.Set }
multi sub infix:<(-)>(BagHash:D \a) { a.Bag } multi sub infix:<(-)>(BagHash:D \a) { a.Bag }
multi sub infix:<(-)>(MixHash:D \a) { a.Mix } multi sub infix:<(-)>(MixHash:D \a) { a.Mix }
multi sub infix:<(-)>(Any \a) { a.Set } # also for Iterable/Map
multi sub infix:<(-)>(Setty:D \a, Setty:D \b) { multi sub infix:<(-)>(Setty:D \a, Setty:D \b) {
nqp::if( nqp::if(
(my $araw := a.RAW-HASH) && nqp::elems($araw) (my $araw := a.RAW-HASH) && nqp::elems($araw)
&& (my $braw := b.RAW-HASH) && nqp::elems($braw), && (my $braw := b.RAW-HASH) && nqp::elems($braw),
nqp::create(a.Setty).SET-SELF( # both have elems nqp::create(a.Setty).SET-SELF( # both have elems
Rakudo::QuantHash.SUB-SET-FROM-SET($araw, $braw) Rakudo::QuantHash.SUB-SET-FROM-SET($araw, $braw)
), ),
a # no elems in a or b a # no elems in a or b
) )
skipping to change at line 95 skipping to change at line 94
multi sub infix:<(-)>(Any \a, Baggy:D \b) { multi sub infix:<(-)>(Any \a, Baggy:D \b) {
Rakudo::QuantHash.DIFFERENCE-BAGGY-QUANTHASH(a.Bag, b) Rakudo::QuantHash.DIFFERENCE-BAGGY-QUANTHASH(a.Bag, b)
} }
multi sub infix:<(-)>(Any \a, Map:D \b) { infix:<(-)>(a.Set, b) } multi sub infix:<(-)>(Any \a, Map:D \b) { infix:<(-)>(a.Set, b) }
multi sub infix:<(-)>(Any \a, Iterable:D \b) { infix:<(-)>(a.Set, b) } multi sub infix:<(-)>(Any \a, Iterable:D \b) { infix:<(-)>(a.Set, b) }
multi sub infix:<(-)>(Any $, Failure:D \b) { b.throw } multi sub infix:<(-)>(Any $, Failure:D \b) { b.throw }
multi sub infix:<(-)>(Failure:D \a, Any $) { a.throw } multi sub infix:<(-)>(Failure:D \a, Any $) { a.throw }
multi sub infix:<(-)>(Any \a, Any \b) { infix:<(-)>(a.Set,b.Set) } multi sub infix:<(-)>(Any \a, Any \b) { infix:<(-)>(a.Set,b.Set) }
multi sub infix:<(-)>(**@p) { multi sub infix:<(-)>(+@p) { # also Any
sub subtract(Mu \elems, Mu \iter, \clone, \value --> Nil) { sub subtract(Mu \elems, Mu \iter, \clone, \value --> Nil) {
nqp::stmts( nqp::stmts(
(my $pair := nqp::ifnull( (my $pair := nqp::ifnull(
nqp::atkey(elems, nqp::iterkey_s(iter)), nqp::atkey(elems, nqp::iterkey_s(iter)),
nqp::bindkey( nqp::bindkey(
elems, elems,
nqp::iterkey_s(iter), nqp::iterkey_s(iter),
nqp::if( nqp::if(
clone, clone,
 End of changes. 2 change blocks. 
2 lines changed or deleted 1 lines changed or added

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