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

hyper messes up order of the results (i.e. @result !~~ @result.sort) #4967

Closed
p6rt opened this issue Dec 31, 2015 · 6 comments
Closed

hyper messes up order of the results (i.e. @result !~~ @result.sort) #4967

p6rt opened this issue Dec 31, 2015 · 6 comments

Comments

@p6rt
Copy link

p6rt commented Dec 31, 2015

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

Searchable as RT127099$

@p6rt
Copy link
Author

p6rt commented Dec 31, 2015

From @AlexDaniel

Code​:
my @​result = ^1000 .hyper.map​: * + 10;
say @​result ~~ @​result.sort

Result​:
False

「hyper」 is supposed to give results in the original order.
“The order of elements is preserved.” (http://doc.perl6.org/routine/hyper)

However, the order is definitely messed up.

Here is an example on camelia​:

<ZoffixWin> m​: my @​result = ^10 .hyper(​:1batch).map​: *+0; say [@​result,
@​result.sort]
<camelia> rakudo-moar eca5df​: OUTPUT«[[0 2 1 3 4 5 6 8 9 7] (0 1 2 3 4 5 6
7 8 9)]␤»

The output is not consistent, every time you run it you can get a new
result.

@p6rt
Copy link
Author

p6rt commented Dec 31, 2015

From @timo

I've got a fix in the hyper_tracks_sequence_numbers
<https://github.com/rakudo/rakudo/compare/hyper_tracks_sequence_numbers>
branch on github, but as the commit message of the first commit on that
branch says, the codes wants to be rewritten or at least cleaned up a
good bit.

@p6rt
Copy link
Author

p6rt commented Dec 31, 2015

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

@p6rt
Copy link
Author

p6rt commented Aug 25, 2016

From @coke

On Wed Dec 30 16​:00​:38 2015, alex.jakimenko@​gmail.com wrote​:

Code​:
my @​result = ^1000 .hyper.map​: * + 10;
say @​result ~~ @​result.sort

Result​:
False

「hyper」 is supposed to give results in the original order.
“The order of elements is preserved.” (http://doc.perl6.org/routine/hyper)

However, the order is definitely messed up.

Here is an example on camelia​:

<ZoffixWin> m​: my @​result = ^10 .hyper(​:1batch).map​: *+0; say [@​result,
@​result.sort]
<camelia> rakudo-moar eca5df​: OUTPUT«[[0 2 1 3 4 5 6 8 9 7] (0 1 2 3 4 5 6
7 8 9)]␤»

The output is not consistent, every time you run it you can get a new
result.

This is working with a recent rakudo, and is closable with tests.

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Sep 10, 2016

From @zoffixznet

Tests added in Raku/roast@c14b344a75

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

p6rt commented Sep 10, 2016

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant