Skip Menu |
Report information
Id: 133016
Status: open
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: wellnhofer [at] aevum.de
Cc:
AdminCc:

Severity: (no value)
Tag: testneeded
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Date: Fri, 23 Mar 2018 14:54:34 +0100
From: Nick Wellnhofer <wellnhofer [...] aevum.de>
Subject: Wrong set difference of Bag and List
To: rakudobug [...] perl.org
Download (untitled) / with headers
text/plain 764b
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
Date: Sat, 24 Mar 2018 09:42:33 +0100
From: Elizabeth Mattijsen <liz [...] dijkmat.nl>
Subject: Re: [perl #133016] Wrong set difference of Bag and List
To: "Nick Wellnhofer (via RT)" <perl6-bugs-followup [...] perl.org>
Download (untitled) / with headers
text/plain 1.1k
That does indeed look wrong to me, investigating Show quoted text
> On 23 Mar 2018, at 15:04, Nick Wellnhofer (via RT) <perl6-bugs-followup@perl.org> wrote: > > # 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
FWIW bisectable points to (2017-06-25) https://github.com/rakudo/rakudo/commit/a2133dbc6a00d1f87bb0644c829591144381d736

( before that it was giving bag(a, b) or bag(b, a) )

On 2018-03-24 01:43:59, elizabeth wrote:
Show quoted text
> That does indeed look wrong to me, investigating
>
> > On 23 Mar 2018, at 15:04, Nick Wellnhofer (via RT) <perl6-bugs-
> > followup@perl.org> wrote:
> >
> > # 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


Subject: Re: [perl #133016] Wrong set difference of Bag and List
From: Elizabeth Mattijsen <liz [...] dijkmat.nl>
Date: Thu, 12 Apr 2018 16:21:33 +0200
To: perl6-bugs-followup [...] perl.org
Download (untitled) / with headers
text/plain 1.5k
Fixed with 344a64e987 , tests needed Show quoted text
> On 24 Mar 2018, at 15:01, Aleks-Daniel Jakimenko-Aleksejev via RT <perl6-bugs-followup@perl.org> wrote: > > FWIW bisectable points to (2017-06-25) > https://github.com/rakudo/rakudo/commit/a2133dbc6a00d1f87bb0644c829591144381d736 > > ( before that it was giving bag(a, b) or bag(b, a) ) > > On 2018-03-24 01:43:59, elizabeth wrote:
>> That does indeed look wrong to me, investigating >>
>>> On 23 Mar 2018, at 15:04, Nick Wellnhofer (via RT) <perl6-bugs- >>> followup@perl.org> wrote: >>> >>> # 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


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org