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

Interpolation at edge of quoteword items cancels out inter-item space #3264

Closed
p6rt opened this issue Nov 4, 2013 · 4 comments
Closed

Interpolation at edge of quoteword items cancels out inter-item space #3264

p6rt opened this issue Nov 4, 2013 · 4 comments

Comments

@p6rt
Copy link

p6rt commented Nov 4, 2013

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

Searchable as RT120449$

@p6rt
Copy link
Author

p6rt commented Nov 4, 2013

From @ShimmerFairy

<TimToady> p​: say «{4 + 2} 4+2»
<camelia> rakudo-parrot 215ba6​: OUTPUT«64+2␤»
<TimToady> so where's the space?
<TimToady> p​: say ((6,),'4+2')
<camelia> rakudo-parrot 215ba6​: OUTPUT«6 4+2␤»
<lue> n​: say «{4 + 2} 4+2»
<camelia> niecza v24-98-g473bd20​: OUTPUT«6 4+2␤»

<lue> p​: say «1 2 3»
<camelia> rakudo-parrot 215ba6​: OUTPUT«1 2 3␤»
<lue> p​: say «1 see{2} 3»
<camelia> rakudo-parrot 215ba6​: OUTPUT«1 see23␤»
<lue> o.o
<lue> p​: say «1 see{2}it 3»
<camelia> rakudo-parrot 215ba6​: OUTPUT«1 see2it 3␤»

In rakudo, if an interpolation occurs at the edge of a «» quoteword item, the space separating the two items at that edge fails to appear.

<TimToady> p​: say «1 {2} 3».perl
<camelia> rakudo-parrot 215ba6​: OUTPUT«("1", ("2",).list, "3")␤»
<TimToady> p​: say ("1", ("2",).list, "3")
<camelia> rakudo-parrot 215ba6​: OUTPUT«1 2 3␤»
<TimToady> p​: say ("1", ("2",).list, "3").gist
<camelia> rakudo-parrot 215ba6​: OUTPUT«1 2 3␤»
<TimToady> p​: say ("1", ("2",).list, "3").Str
<camelia> rakudo-parrot 215ba6​: OUTPUT«1 2 3␤»
<TimToady> p​: say ~("1", ("2",).list, "3")
<camelia> rakudo-parrot 215ba6​: OUTPUT«1 2 3␤»
<TimToady> so, what's eating the space?

<lue> p​: say qqw/1 {2} 3/
<camelia> rakudo-parrot 215ba6​: OUTPUT«1 2 3␤»

As seen here, it's seems to be specific to the «» construct, not the .perl of the quoteword list, nor even the qqw construct. Just the guillemets.

Some non-closure examples​:

<TimToady> n​: my $x = 2; say «1 '$x' 3»
<camelia> niecza v24-98-g473bd20​: OUTPUT«1 '2' 3␤»
* woosley (~woosley@​210.13.87.122) has joined
<TimToady> p​: my $x = 2; say «1 '$x' 3»
<camelia> rakudo-parrot 215ba6​: OUTPUT«1$x3␤»
<TimToady> p​: my $x = 2; say «1 "$x" 3»
<camelia> rakudo-parrot 215ba6​: OUTPUT«123␤»
<lue> p​: my $x = 2; say «1 $x 3»
<camelia> rakudo-parrot 215ba6​: OUTPUT«123␤»

<lue> p​: say «1 '2' 3»
<camelia> rakudo-parrot 215ba6​: OUTPUT«123␤»
<lue> p​: say «1 ''2 3»
<camelia> rakudo-parrot 215ba6​: OUTPUT«12 3␤»

The fun starts here for reference​: http://irclog.perlgeek.de/perl6/2013-11-04#i_7809016

@p6rt
Copy link
Author

p6rt commented Oct 28, 2015

From @usev6

This works now as expected -- e.g.​:

$ perl6 -e 'my $x = 2; say «1 $x 3»'
(1 2 3)

$ perl6 -e 'say «{4 + 2} 4+2»'
(6 4+2)

I added a test to S02-literals/string-interpolation.t with commit Raku/roast@8e47b67

I'm closing this ticket as 'resolved'.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Oct 28, 2015

From @usev6

This works now as expected -- e.g.​:

$ perl6 -e 'my $x = 2; say «1 $x 3»'
(1 2 3)

$ perl6 -e 'say «{4 + 2} 4+2»'
(6 4+2)

I added a test to S02-literals/string-interpolation.t with commit Raku/roast@8e47b67

I'm closing this ticket as 'resolved'.

@p6rt p6rt closed this as completed Oct 28, 2015
@p6rt
Copy link
Author

p6rt commented Oct 28, 2015

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant