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
Should junctions collapse unique values? #6180
Comments
From @briandfoy# using Rakudo 2017.01 Should junctions only care about unique values? For example, does 3 need to be in the junction twice? > my $j = any( 1, 2, 3, 3 ) I ran into this when I was playing around with something like > $j > 5 Curiously, I expected the result would be either True or False Consider how this propagates: > $j > any( 5, 2 ) As a boolean value, this is merely a baroque True. Since junctions |
From @AlexDanielSomething to note: Code: Result: Also, trying to filter out unique values in a junction is probably more costly than just doing whatever operation you've got with each element (in most cases at least). On 2017-04-07 04:49:58, comdog wrote:
|
The RT System itself - Status changed from 'new' to 'open' |
From @zoffixznetHi,
No, Junctions aren't about unique values. They're a superposition of values that threads through routines without them even knowing they're working with a Junction: m: my $a = 3|3; my $x++ for ^$a; say $x In the future, when seeking support, would it be possible for you to use proper support channels, instead of the bug reporting system, as a means to ask questions? There are plenty of venues available to cater to all tastes: IRC: https://webchat.freenode.net/?channels=#perl6 There are plenty of helping hands to go around. |
@zoffixznet - Status changed from 'open' to 'rejected' |
From @briandfoyI consider it a bug that a Junction does what its doing, and reported For questions, I use Stackoverflow. However, other people keep telling |
From @lizmat
I think this is uncalled for. brian is using StackOverflow for questions. And one *could* think this is a bug. And I don’t see this kind of reaction when other people post RT tickets with similar issues that may or may not be bugs. So please, treat everybody the same! :-)
Indeed. A good list. Is this published anywhere? Liz |
From @lizmat
I would argue yes for two reasons: 1. What determines when something is unique?
Now, Booleanising a junction *does* collapse: $ 6 'my $j = any(1,2,3); say ($j > 5).Bool' The REPL doesn’t booleanize, and thus you see the whole junction: $ 6 'my $j = any(1,2,3); say $j > 5'
Again, the REPL is not booleanizing: $ 6 'my $j = any(1,2,3); say $j > any( 5, 2 )' If you do, it does *exactly* what you expect: $ 6 'my $j = any(1,2,3); say ($j > any( 5, 2 )).Bool’ or: $ 6 'my $j = any(1,2,3); say ?($j > any( 5, 2 ))’ I think this ticket can be closed. |
From @briandfoyI figured the comparison operator would Booleanize, because that's how If it's something else, the Operators docs should explain it in another way. |
Migrated from rt.perl.org#131114 (status was 'rejected')
Searchable as RT131114$
The text was updated successfully, but these errors were encountered: