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

backslash escapes in double-angle quotes #1880

Closed
p6rt opened this issue Jun 26, 2010 · 6 comments
Closed

backslash escapes in double-angle quotes #1880

p6rt opened this issue Jun 26, 2010 · 6 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Jun 26, 2010

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

Searchable as RT76120$

@p6rt
Copy link
Author

p6rt commented Jun 26, 2010

From @moritz

18​:21 <@​moritz_> rakudo​: say :foo<<string\ here>>.perl
18​:21 <+p6eval> rakudo 142433​: OUTPUT«"foo" => ("string\\", "here")␤»
18​:21 <@​moritz_> alpha​: say :foo<<string\ here>>.perl
18​:21 <+p6eval> alpha 30e0ed​: OUTPUT«"foo" => "string here"␤»
18​:21 <@​moritz_> rakudobug!

and even worse, silently swallows the backslash​:

18​:22 <@​moritz_> rakudo​: say «a\ b».perl
18​:23 <+p6eval> rakudo 142433​: OUTPUT«("a", "b")␤»

@p6rt
Copy link
Author

p6rt commented Jul 29, 2010

@coke - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Oct 4, 2011

From @coke

On Sat Jun 26 09​:24​:14 2010, moritz wrote​:

18​:21 <@​moritz_> rakudo​: say :foo<<string\ here>>.perl
18​:21 <+p6eval> rakudo 142433​: OUTPUT«"foo" => ("string\\", "here")␤»
18​:21 <@​moritz_> alpha​: say :foo<<string\ here>>.perl
18​:21 <+p6eval> alpha 30e0ed​: OUTPUT«"foo" => "string here"␤»
18​:21 <@​moritz_> rakudobug!

and even worse, silently swallows the backslash​:

18​:22 <@​moritz_> rakudo​: say «a\ b».perl
18​:23 <+p6eval> rakudo 142433​: OUTPUT«("a", "b")␤»

Still failing the same way in rakudo 7408d6

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Jul 19, 2014

From @peschwa

On Tue Oct 04 06​:16​:13 2011, coke wrote​:

On Sat Jun 26 09​:24​:14 2010, moritz wrote​:

18​:21 <@​moritz_> rakudo​: say :foo<<string\ here>>.perl
18​:21 <+p6eval> rakudo 142433​: OUTPUT«"foo" => ("string\\", "here")␤»
18​:21 <@​moritz_> alpha​: say :foo<<string\ here>>.perl
18​:21 <+p6eval> alpha 30e0ed​: OUTPUT«"foo" => "string here"␤»
18​:21 <@​moritz_> rakudobug!

and even worse, silently swallows the backslash​:

18​:22 <@​moritz_> rakudo​: say «a\ b».perl
18​:23 <+p6eval> rakudo 142433​: OUTPUT«("a", "b")␤»

Still failing the same way in rakudo 7408d6

As of now, general backslash escapes seem to work inside << >>, e.g. \x, \o​:

16​:28 < psch> m​: say <<\x61 \o142>> # this case works at least
16​:28 <+camelia> rakudo-moar 866817​: OUTPUT«a b␤»

I suspect the original ticket is more about the interpretation of "\ ". Niecza and Rakudo both currently assume that backslash-space means space​:

16​:32 <psch> p6​: say "a\ b"
16​:32 <camelia> rakudo-{parrot,jvm,moar} 866817, niecza v24-109-g48a8de3​: OUTPUT«a b␤»

I can see unspace inside qq Strings having at least one possible application, that of formatting a very long literal String in the source code, but I don't know if that's a useful enough feature to have, as "..." ~ \n "..." does it already.

@p6rt
Copy link
Author

p6rt commented Nov 5, 2017

From @AlexDaniel

This ticket is really old, but the issue is still there. I'm closing this in favor of rakudo/rakudo#1234 (which is a new ticket for the same issue but with a little bit more info).
On 2014-07-19 07​:52​:17, peschwa@​gmail.com wrote​:

On Tue Oct 04 06​:16​:13 2011, coke wrote​:

On Sat Jun 26 09​:24​:14 2010, moritz wrote​:

18​:21 <@​moritz_> rakudo​: say :foo<<string\ here>>.perl
18​:21 <+p6eval> rakudo 142433​: OUTPUT«"foo" => ("string\\",
"here")␤»
18​:21 <@​moritz_> alpha​: say :foo<<string\ here>>.perl
18​:21 <+p6eval> alpha 30e0ed​: OUTPUT«"foo" => "string here"␤»
18​:21 <@​moritz_> rakudobug!

and even worse, silently swallows the backslash​:

18​:22 <@​moritz_> rakudo​: say «a\ b».perl
18​:23 <+p6eval> rakudo 142433​: OUTPUT«("a", "b")␤»

Still failing the same way in rakudo 7408d6

As of now, general backslash escapes seem to work inside << >>, e.g.
\x, \o​:

16​:28 < psch> m​: say <<\x61 \o142>> # this case works at least
16​:28 <+camelia> rakudo-moar 866817​: OUTPUT«a b␤»

I suspect the original ticket is more about the interpretation of "\
". Niecza and Rakudo both currently assume that backslash-space means
space​:

16​:32 <psch> p6​: say "a\ b"
16​:32 <camelia> rakudo-{parrot,jvm,moar} 866817, niecza v24-109-
g48a8de3​: OUTPUT«a b␤»

I can see unspace inside qq Strings having at least one possible
application, that of formatting a very long literal String in the
source code, but I don't know if that's a useful enough feature to
have, as "..." ~ \n "..." does it already.

@p6rt
Copy link
Author

p6rt commented Nov 5, 2017

@AlexDaniel - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Nov 5, 2017
@p6rt p6rt added the Todo label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant