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
For loops fail to decontainerize in Rakudo #2080
Comments
From @masak<blixtor> perl6: sub foo { my $s; for 1..3 { $s += $_ } } ; say foo() |
From @pmichaudOn Fri, Aug 20, 2010 at 04:39:00AM -0700, Carl Mäsak wrote:
I suspect that any block should de-containerize its return value Pm |
The RT System itself - Status changed from 'new' to 'open' |
From @cokeOn Fri Aug 20 04:39:00 2010, masak wrote:
Behavior has changed: 12:50 < [Coke]> perl6: sub foo { my $s; for 1..3 { $s += $_ } } ; say foo() -- |
From @cokeOn Fri Aug 22 09:52:24 2014, coke wrote:
15:57 < masak> [Coke]: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=77334 is not So, no change, really. masak++ -- |
From @masak<[Coke]> rant: old tickets with "maybe" or "either std or rakudo is wrong" |
From @masak<masak> n: sub foo { my $s = 0; ($s += $_ for 1..3) }; say foo() |
From @jnthnOn Sat Aug 30 08:31:30 2014, masak wrote:
It's a tad more sutble: 15:07 < jnthn> masak: Only tricky thing is that it may not be as simple as So we need to decide if we care to retain the meaning of the $ in such cases, and perhaps rule on the sub case too: 15:09 < jnthn> So we more need the return from sub semantics (recont if Iterable) |
From @jnthnOn Fri Aug 22 13:46:45 2014, coke wrote:
TimToady++ has ruled that `for` should not decontainerize, on the basis that it's easy enough to make it not do so (such as with the <> postfix) but there's not an easy way to avoid the decontainerization if you don't want it. Also, there's usually a better way to write these things. Discussion: http://irclog.perlgeek.de/perl6/2015-10-27#i_11440206 Tests covering this ruling in S04-statement-modifiers/for.t and S04-statements/for.t. |
@jnthn - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#77334 (status was 'resolved')
Searchable as RT77334$
The text was updated successfully, but these errors were encountered: