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?

> On 12 Aug 2016, at 05:19, Wenzel Peppmeyer (via RT) 
> <perl6-bugs-follo...@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.

Reply via email to