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

Owner: Nobody
Requestors: gfldex <wenzel.peppmeyer [at] gmx.de>
Cc:
AdminCc:

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



Subject: [BUG] SetHash::push not implemented
To: rakudobug [...] perl.org
Date: Fri, 12 Aug 2016 05:18:57 +0200 (CEST)
From: "Wenzel P. P. Peppmeyer" <wenzel.peppmeyer [...] gmx.de>
Download (untitled) / with headers
text/plain 290b
my SetHash $sh .= new; $sh.push('a'); # OUTPUT: # OUTPUT«Cannot resolve caller push(SetHash: Str); none of these signatures match:␤ (Any:U \SELF: |values is raw)␤ in block <unit> <tmp> line 1␤» # Any::push tries to call SetHash::push and fails because there is no such # method.
Subject: Re: [perl #128903] [BUG] SetHash::push not implemented
To: "Wenzel Peppmeyer (via RT)" <perl6-bugs-followup [...] perl.org>
Date: Fri, 12 Aug 2016 22:56:30 +0200
From: Elizabeth Mattijsen <liz [...] dijkmat.nl>
CC: bugs-bitbucket [...] rt.perl.org
Download (untitled) / with headers
text/plain 686b
Will look at this as part of a Set/SetHash overhaul Show quoted text
> On 12 Aug 2016, at 05:19, Wenzel Peppmeyer (via RT) <perl6-bugs-followup@perl.org> wrote: > > # New Ticket Created by Wenzel Peppmeyer > # Please include the string: [perl #128903] > # in the subject line of all future correspondence about this issue. > # <URL: https://rt.perl.org/Ticket/Display.html?id=128903 > > > > my SetHash $sh .= new; $sh.push('a'); > > # OUTPUT: > # OUTPUT«Cannot resolve caller push(SetHash: Str); none of these signatures match:␤ (Any:U \SELF: |values is raw)␤ in block <unit> <tmp> line 1␤» > > # Any::push tries to call SetHash::push and fails because there is no such > # method.
Subject: Re: [perl #128903] [BUG] SetHash::push not implemented
To: "Wenzel Peppmeyer (via RT)" <perl6-bugs-followup [...] perl.org>
Date: Tue, 16 Aug 2016 18:01:21 +0200
From: Elizabeth Mattijsen <liz [...] dijkmat.nl>
CC: bugs-bitbucket [...] rt.perl.org
Download (untitled) / with headers
text/plain 1.2k
Looking at implementing this for SetHashes / BagHashes / MixHashes, I’m not sure we should do this. Because, even though you could consider SetHashes/BagHashes/MixHashes as Hashy things, the semantics of a .push and an .append would be very much different from Hash.push/append. That’s because Hash.push/append expects (implicit) key/value Pairs, whereas Sets/Bags/Mixes would only be able to take keys. I *do* see the benefit of being able to add a list of values onto a SetHash/BagHash/MixHash. I’m not sure it should be called .push or .append. On the other hand, you could consider the Hash.push/append the odd ones out… Suggestions? Show quoted text
> On 12 Aug 2016, at 05:19, Wenzel Peppmeyer (via RT) <perl6-bugs-followup@perl.org> wrote: > > # New Ticket Created by Wenzel Peppmeyer > # Please include the string: [perl #128903] > # in the subject line of all future correspondence about this issue. > # <URL: https://rt.perl.org/Ticket/Display.html?id=128903 > > > > my SetHash $sh .= new; $sh.push('a'); > > # OUTPUT: > # OUTPUT«Cannot resolve caller push(SetHash: Str); none of these signatures match:␤ (Any:U \SELF: |values is raw)␤ in block <unit> <tmp> line 1␤» > > # Any::push tries to call SetHash::push and fails because there is no such > # method.
Download (untitled) / with headers
text/plain 205b
Show quoted text
> I *do* see the benefit of being able to add a list of values onto a > SetHash/BagHash/MixHash.
One can already do: $sethash{@new-items} = True xx *; But admittedly, that's not as newbie-friendly.
Download (untitled) / with headers
text/plain 489b
On Mon, 29 Aug 2016 04:12:57 -0700, smls75@gmail.com wrote: Show quoted text
> > I *do* see the benefit of being able to add a list of values onto a > > SetHash/BagHash/MixHash.
> > One can already do: > > $sethash{@new-items} = True xx *; > > But admittedly, that's not as newbie-friendly.
I wouldn't call that expert-friendly either. Values aren't the interesting bit of sets and them being True is on the implementation-detail side of things. Moreover, that construct won't work with baggies.


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