# New Ticket Created by  Nick Wellnhofer 
# Please include the string:  [perl #133016]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=133016 >


I get an unexpected result when subtracting a List from a Bag with the set 
difference operator (-). Subtracting Bags from Lists or Bags works fine, as 
does the baggy addition operator:

     say bag(<a b>) (+) bag(<a a>);      # Bag(a(3), b)
     say bag(<a b>) (+) <a a>;           # Bag(a(3), b)
     say      <a b> (+) bag(<a a>);      # Bag(a(3), b)

     say bag(<a a a b>) (-) bag(<a a>);  # Bag(a, b)
     say bag(<a a a b>) (-) <a a>;       # Bag(a(2), b) seems wrong
     say      <a a a b> (-) bag(<a a>);  # Bag(a, b)

Only tested online on tio.run

     Rakudo version 2017.12 built on MoarVM version 2017.12
     implementing Perl 6.c.

and code-golf.io:

     Rakudo version 2018.03 built on MoarVM version 2018.03
     implementing Perl 6.c

Nick

Reply via email to