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
Inconsistent for loop semantics #237
Comments
From @masakr30258: $ ./perl6 -e 'for [1,2,3] { .say }' # shouldn't that be the same? $ ./perl6 -e 'for [1,2,3] -> $a { say $a }' # or this? $ ./perl6 -e 'for [1,2,3].list { .say }' # how do I make it... $ ./perl6 -e 'for @([1,2,3]) { .say }' # ...loop over the elements? $ ./perl6 -e 'for [1,2,3].clone { .say }' # aha! um... All in all, it's difficult to actually loop on the contents of an |
From @masakIt was revision 28928 that introduced this difference between the for $ svn log -r28928 r28928 | pmichaud | 2008-07-02 03:37:22 +0200 (Wed, 02 Jul 2008) | 4 lines [rakudo]: $ svn di -r28927:28928
|
From @pmichaudOn Fri, Aug 15, 2008 at 11:15:46PM -0700, Carl Mäsak wrote:
This one is actually incorrect in Rakudo -- at least according to Rakudo's output is likely incorrect for one or two reasons: Until #57352 is resolved, the better test (which Rakudo also $ ./perl6 -e '.say() for [1,2,3]'
This one is correct (both Rakudo and Pugs).
This one is also correct (Rakudo and Pugs).
The reason that the output is "1 2 3\n" and not "1\n2\n3\n" To loop over the elements it ought to be for [1,2,3].values { .say } Rakudo currently has this wrong also -- I suspect that it's
Yes, there are some bugs here -- several of the List methods Pm |
The RT System itself - Status changed from 'new' to 'open' |
From @pmichaudNow resolved in r32094. Some specific notes below: On Mon, Aug 18, 2008 at 03:39:18AM -0500, Patrick R. Michaud wrote:
Oops! C<.say> isn't a listop when it doesn't have a trailing
This now works also. We still have a fair bit of refactoring Thanks! Pm |
@pmichaud - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#57960 (status was 'resolved')
Searchable as RT57960$
The text was updated successfully, but these errors were encountered: