Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

RT #74060, statment modifying "for" in list comprehension

  • Loading branch information...
commit 87f3d51029b413ccbd665dcccefa7bc715304007 1 parent ed9af51
@moritz moritz authored
Showing with 8 additions and 1 deletion.
  1. +8 −1 S04-statements/for.t
View
9 S04-statements/for.t
@@ -13,7 +13,7 @@ for statement as possible
=end description
-plan 70;
+plan 71;
## No foreach
# L<S04/The C<for> statement/"no foreach statement any more">
@@ -521,4 +521,11 @@ lives_ok {
is ~f(), '', 'empty for-loop returns empty list';
}
+# RT #74060
+# more list comprehension
+{
+ my @s = ($_ * 2 if $_ ** 2 > 3 for 0 .. 5);
+ is ~@s, '4 9 16 25', 'Can use statement-modifying "for" in list comprehension';
+}
+
# vim: ft=perl6
Please sign in to comment.
Something went wrong with that request. Please try again.