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
Flattened list iteration #5819
Comments
From tim.bollman@live.comIt appears that when iterating lazily through a list that's been flattened (the first time), sometimes certain elements are not reached. For background I was writing some code that used a trie, and was attempting to find the word "inclusive" out of input trigrams. I have cleared away as much of the surrounding code as I could to provide a minimal test case. If you enable the commented line (or otherwise iterate through the @partials list at least once first), the output will be correct. Thanks, use v6; sub find-words(@partials) { my @found = gather find-words(<ive lus inc>); |
From tim.bollman@live.comI've determined that the issue is the +@partials. Sometimes that is returning 1 as the length of the list instead of the full list. It looks to be whenever the first index set returns the empty set, the size calculation fails. ________________________________ Greetings, This message has been automatically generated in response to the There is no need to reply to this message right now. Your ticket has been Please include the string: [perl #130160] in the subject line of all future correspondence about this issue. To do so, Thank you, It appears that when iterating lazily through a list that's been flattened (the first time), sometimes certain elements are not reached. For background I was writing some code that used a trie, and was attempting to find the word "inclusive" out of input trigrams. I have cleared away as much of the surrounding code as I could to provide a minimal test case. If you enable the commented line (or otherwise iterate through the @partials list at least once first), the output will be correct. Thanks, use v6; sub find-words(@partials) { my @found = gather find-words(<ive lus inc>); |
From lucasbuchala@gmail.comI found this results that may be related to this issue. > my @a := <a b c>[0..2, 0..2].flat.cache; say @a > my @a := <a b c>[0..2, 0..2].flat.cache; @a.Bool; @a.elems; say @a > my @a := <a b c>[0..2, 0..2].flat.cache; @a.eager; @a.Bool; @a.elems; say @a |
The RT System itself - Status changed from 'new' to 'open' |
From @zoffixznetOn Wed, 23 Nov 2016 17:15:41 -0800, TimTom wrote:
Thanks for the report. Fixed in rakudo/rakudo@61a18c0 |
@zoffixznet - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#130160 (status was 'resolved')
Searchable as RT130160$
The text was updated successfully, but these errors were encountered: