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

Non-dwimmy hyper hash addition warns about missing keys in Rakudo #3148

Closed
p6rt opened this issue May 28, 2013 · 6 comments
Closed

Non-dwimmy hyper hash addition warns about missing keys in Rakudo #3148

p6rt opened this issue May 28, 2013 · 6 comments
Labels

Comments

@p6rt
Copy link

@p6rt p6rt commented May 28, 2013

Migrated from rt.perl.org#118223 (status was 'resolved')

Searchable as RT118223$

@p6rt
Copy link
Author

@p6rt p6rt commented May 28, 2013

From @masak

<masak> r​: my %l = foo => 1, bar => 2; my %r = bar => 3, baz => 4; say
%l >>+<< %r
<camelia> rakudo 25a0b3​: OUTPUT«use of uninitialized value of type Any
in numeric context in block at /tmp/OI858EugnG​:1␤␤use of
uninitialized value of type Any in numeric context in block at
/tmp/OI858EugnG​:1␤␤("foo" => 1, "bar" => 5, "baz" => 4).hash␤»
<masak> I must say I don't need that one often... but when I do, it's
*very* nice to have.
<masak> what's with all the warnings, though?
<isBEKaml> heh, what does >>+<< on hashes mean? do we take in keys too?
<masak> isBEKaml​: do the operation on the values. >>+<< takes the
union of the keys; <<+>> takes the intersection.
<masak> isBEKaml​: in this case I needed the union.
<masak> which is why I think the undefinedness warnings are unnecessary.
<masak> I *know* some keys/values are missing. that's why I did >>+<<
* masak submits rakudobug

@p6rt
Copy link
Author

@p6rt p6rt commented Sep 2, 2016

From @MasterDuke17

On Tue May 28 10​:11​:39 2013, masak wrote​:

<masak> r​: my %l = foo => 1, bar => 2; my %r = bar => 3, baz => 4; say
%l >>+<< %r
<camelia> rakudo 25a0b3​: OUTPUT«use of uninitialized value of type Any
in numeric context in block at /tmp/OI858EugnG​:1␤␤use of
uninitialized value of type Any in numeric context in block at
/tmp/OI858EugnG​:1␤␤("foo" => 1, "bar" => 5, "baz" => 4).hash␤»
<masak> I must say I don't need that one often... but when I do, it's
*very* nice to have.
<masak> what's with all the warnings, though?
<isBEKaml> heh, what does >>+<< on hashes mean? do we take in keys too?
<masak> isBEKaml​: do the operation on the values. >>+<< takes the
union of the keys; <<+>> takes the intersection.
<masak> isBEKaml​: in this case I needed the union.
<masak> which is why I think the undefinedness warnings are unnecessary.
<masak> I *know* some keys/values are missing. that's why I did >>+<<
* masak submits rakudobug

<MasterDuke> m​: my %l = foo => 1, bar => 2; my %r = bar => 3, baz => 4; say %l >>+<< %r
<camelia> rakudo-moar d2b115​: OUTPUT«Use of uninitialized value of type Any in numeric context␤ in block <unit> at <tmp> line 1␤Use of uninitialized value of type Any in numeric context␤ in block <unit> at <tmp> line 1␤{bar => 5, baz => 4, foo => 1}␤»
<MasterDuke> m​: my %l = foo => 1, bar => 2; my %r = bar => 3, baz => 4; quietly say %l >>+<< %r
<camelia> rakudo-moar d2b115​: OUTPUT«{bar => 5, baz => 4, foo => 1}␤»
<MasterDuke> so there is a built in way to suppress those warnings
<MasterDuke> it looks like quietly was implemented two years after the RT

Is this (still) a bug?

@p6rt
Copy link
Author

@p6rt p6rt commented Sep 2, 2016

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

@p6rt
Copy link
Author

@p6rt p6rt commented Sep 2, 2016

From @masak

Is this (still) a bug?

<masak> MasterDuke​: yes, still a bug.
<masak> MasterDuke​: "you can turn off the warnings" is at most a fine workaround.
<masak> but the spec is clear that there shouldn't be any warnings in the first place.
<masak> quoting myself from that ticket​: ">>+<< takes the union of the keys; <<+>> takes the intersection. I *know* some keys/values are missing. that's why I did >>+<<" (union)
<masak> warnings should give new information, not bug me about things I knew when I wrote the code.
* masak adds this to the ticket
<MasterDuke> cool, i'll keep playing around with it

@p6rt
Copy link
Author

@p6rt p6rt commented Sep 15, 2016

From @MasterDuke17

On Fri Sep 02 05​:36​:10 2016, masak wrote​:

Is this (still) a bug?

<masak> MasterDuke​: yes, still a bug.
<masak> MasterDuke​: "you can turn off the warnings" is at most a fine
workaround.
<masak> but the spec is clear that there shouldn't be any warnings in
the first place.
<masak> quoting myself from that ticket​: ">>+<< takes the union of the
keys; <<+>> takes the intersection. I *know* some keys/values are
missing. that's why I did >>+<<" (union)
<masak> warnings should give new information, not bug me about things
I knew when I wrote the code.
* masak adds this to the ticket
<MasterDuke> cool, i'll keep playing around with it

Some commentary from jnthn here http://irclog.perlgeek.de/perl6-dev/2016-09-12#i_13194037

Fixed here rakudo/rakudo#859

Test added here Raku/roast@8b2446dc94

@p6rt p6rt closed this as completed Sep 15, 2016
@p6rt
Copy link
Author

@p6rt p6rt commented Sep 15, 2016

@MasterDuke17 - Status changed from 'open' to 'resolved'

@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
Labels
Projects
None yet
Development

No branches or pull requests

1 participant