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
feature request: lazy evaluated list: keyword lazy #5154
Comments
From Greg.London@infineon.comCurrent format for a lazily evaluated list: my $lazylist = (0, { $_ + 3 } ...^ * > 10); ^*> is incoherent line noise. Please consider making a builtin function that looks kind of like a "for loop" but is lazily evaluated. my $lazylist = lazy ($_=0; $_ <= 10; $_+=3); The syntax for a FOR() loop is well established and already has everything needed to define a lazy list. Keep the line noise version if you want, but a lazy() function would be much more natural and intuitive for oddball situations and would need almost zero explanation. |
From @cokeOn Mon Feb 22 14:43:21 2016, Greg.London@infineon.com wrote:
Thanks for trying out Perl 6. In case this wasn't just a rant, the ^ here is tied to the sequence, and means The * is a Whatever star, and is ubiquitous in Perl 6. It's a way to generate So, as it turns out, this isn't really a list that needs lazifying, it's only got
In Perl 6, the C-style for loop you reference is spelled "loop". loop (my $i = 0; $i < 10; $i++) { say $i } # prints out 0 to 9.
Turns out we already have a "lazy". So this code works today. my $lazylist = lazy loop (my $i=0; ; $i++) { $i }; Rejecting ticket. I encourage you to checkout docs.perl6.org -- |
The RT System itself - Status changed from 'new' to 'open' |
@coke - Status changed from 'open' to 'rejected' |
Migrated from rt.perl.org#127601 (status was 'rejected')
Searchable as RT127601$
The text was updated successfully, but these errors were encountered: