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
Gather issues #3380
Comments
So that the underlying iterator *can* be told to act as a lazy iterator. Now all we need is a syntax to mark a `gather` block as lazy. This in response to #3380
An easy fix would be to just mark the
So that's not an option. So I guess we need a syntactic way to mark a In preparation for that, I have added an "is-lazy" attribute to the underlying iterator in b6afa71 |
After 07072f3 the following test runs to completion:
Pinging @jnthn to see if he's ok with this change. |
We do; it's spelled |
No, not when there's already a fine way that's shorter and more regular. :-) Ah, and to add: that |
Ok, I'll revert the last one. And look at making |
Be very careful; it must only do that optimization if it is immediately receiving the |
Yeah, that is becoming difficult. The whole |
@lizmat, I accept that the first Note that I used use Test;
plan 2;
my $seq = gather {
my $i = 0;
while 1 { take $i++ }
};
ok !$seq.is-lazy, '.is-lazy on infinite gather';
$seq.cache;
my $test = start { $seq.is-lazy };
await Promise.anyof($test, Promise.in(5));
ok $test, '.is-lazy does not hang after .cache'; and on the latest Rakudo build the output is:
|
This behaviour is caused by FWIW, I've never fully understood why the caching semantics of |
I'm closing this issue now. Please re-open if you disagree. |
The Problem
A
Seq
produced bygather
does not declare itself to be lazy. Invoking.gist
on an infinite gather makes a subsequent.is-lazy
hang.Expected Behavior
The following tests:
Should output
Actual Behavior
The actual test output is
Environment
perl6 -v
):This is Rakudo Star version 2019.03.1 built on MoarVM version 2019.03
implementing Perl 6.d.
The text was updated successfully, but these errors were encountered: