Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SetHash::push not implemented #5559

Open
p6rt opened this issue Aug 12, 2016 · 6 comments
Open

SetHash::push not implemented #5559

p6rt opened this issue Aug 12, 2016 · 6 comments
Labels
Bug

Comments

@p6rt
Copy link

@p6rt p6rt commented Aug 12, 2016

Migrated from rt.perl.org#128903 (status was 'open')

Searchable as RT128903$

@p6rt

This comment has been minimized.

Copy link
Author

@p6rt p6rt commented Aug 12, 2016

From @gfldex

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.

@p6rt

This comment has been minimized.

Copy link
Author

@p6rt p6rt commented Aug 12, 2016

From @lizmat

Will look at this as part of a Set/SetHash overhaul

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-archive.perl.org/perl6/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.

@p6rt

This comment has been minimized.

Copy link
Author

@p6rt p6rt commented Aug 12, 2016

The RT System itself - Status changed from 'new' to 'open'

@p6rt

This comment has been minimized.

Copy link
Author

@p6rt p6rt commented Aug 16, 2016

From @lizmat

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-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-archive.perl.org/perl6/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.

@p6rt

This comment has been minimized.

Copy link
Author

@p6rt p6rt commented Aug 29, 2016

From @smls

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.

@p6rt

This comment has been minimized.

Copy link
Author

@p6rt p6rt commented Dec 13, 2016

From @zoffixznet

On Mon, 29 Aug 2016 04​:12​:57 -0700, smls75@​gmail.com wrote​:

I *do* see the benefit of being able to add a list of values onto a
SetHash/BagHash/MixHash.

One can already do​:

$sethash\{@&#8203;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.

@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.