# New Ticket Created by David Warring
# Please include the string: [perl #122583]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org/Ticket/Display.html?id=122583 >
List comprehensions are playing up under $(...) interpolation on the JVM.
>From the #perl6 IRC:
23:14 camelia rakudo-moar 688c28: OUTPUT«1 9 25 49 81»
23:15 dwarring m: "{$_ * $_ if $_ !%% 2 for ^10}".say
23:15 camelia rakudo-moar 688c28: OUTPUT«»
23:17 TimToady see S04:658
23:17 synopsebot Link: http://perlcabal.org/syn/S04.html#line_658
23:17 TimToady basically, {} are always going to suppress return value
from loops inside
23:18 after much haggling over the years, that's what we settled on
as Least Surprise
23:18 ss/loops inside/loops directly inside/
23:20 firnsy_ joined #perl6
23:20 * TimToady suspects the optimizer should turn !%% into % in
boolean context, if it doesn't already
23:21 dwarring ok that makes sense
23:22 so I do need to put the loops in parens
23:22 TimToady you can interpolate using $() too
23:23 dwarring r: say "$($_ * $_ if $_ % 2 for 0..10)"
23:24 camelia rakudo-{parrot,moar} 688c28: OUTPUT«1 9 25 49 81»
23:24 ..rakudo-jvm 688c28: OUTPUT«»
23:24 dwarring ahhh!
23:25 err except for jvm
23:25 TimToady huh
23:25 trés peculiar
23:26 dwarring i'll ticket it
...
23:29 TimToady good idea
23:29 j: say "foo$('stuff')bar"
23:29 camelia rakudo-jvm 688c28: OUTPUT«foostuffbar»
23:30 TimToady just seems like the comprehension is what goes astray,
so maybe in sink context for some reason