Skip to content
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

"$( ...)" list interpolation (not in sink context?) #3484

Closed
p6rt opened this issue Aug 21, 2014 · 5 comments
Closed

"$( ...)" list interpolation (not in sink context?) #3484

p6rt opened this issue Aug 21, 2014 · 5 comments
Labels
JVM Related to Rakudo-JVM

Comments

@p6rt
Copy link

p6rt commented Aug 21, 2014

Migrated from rt.perl.org#122583 (status was 'resolved')

Searchable as RT122583$

@p6rt
Copy link
Author

p6rt commented Aug 21, 2014

From @dwarring

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

@p6rt
Copy link
Author

p6rt commented Aug 21, 2014

From @dwarring

Fudged tests added to S02-literals/misc-interpolation.t

On Wed Aug 20 19​:17​:00 2014, david.warring wrote​:

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

@p6rt
Copy link
Author

p6rt commented Oct 6, 2016

From @usev6

The tests in S02-literals/misc-interpolation.t are passing now with rakudo-j. (Fixed with Raku/nqp@2d88d98201)

I'm closing this ticket as 'resolved'.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Oct 6, 2016

From @usev6

The tests in S02-literals/misc-interpolation.t are passing now with rakudo-j. (Fixed with Raku/nqp@2d88d98201)

I'm closing this ticket as 'resolved'.

@p6rt p6rt closed this as completed Oct 6, 2016
@p6rt
Copy link
Author

p6rt commented Oct 6, 2016

@usev6 - Status changed from 'new' to 'resolved'

@p6rt p6rt added the JVM Related to Rakudo-JVM label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
JVM Related to Rakudo-JVM
Projects
None yet
Development

No branches or pull requests

1 participant