REPL pretty-printed output does not distinguish between escape sequences and escaped escape sequences
See original GitHub issueThese strings are different:
scala> "\n"
val res0: String = "\n"
scala> "\\n"
val res1: String = "\n"
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Python ignores escape sequences [duplicate] - Stack Overflow
The problem is that the input does not contain spaces; it contains actual backslashes etc. which need to be converted. Backslash is a...
Read more >escape sequences - Replit
Run Python code live in your browser. Write and run code in 50+ languages online with Replit, a powerful IDE, compiler, & interpreter....
Read more >Escape Sequences in Java - GeeksforGeeks
The total number of escape sequences or escape characters in Java is 8. Each escape character is a valid character literal.
Read more >39 JSON in Oracle Database
You can use explicit ASCII escaping on input data. Because JSON data uses Unicode internally, when it is output, character-set conversion still applies,...
Read more >Strings - Julia Documentation
Conversion via codepoint(char) will not reveal this encoding because it always returns the Unicode value of the character. print(io, c) of any ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Dotty isn’t going to inline anything compiled by Scala 2, including the standard library. Running our standard benchmarks won’t help you here since we don’t benchmark the REPL. In any case, I doubt this is going to make any perceivable difference in performance.
I think this could be fixed by simply adding the backslash as a special case to be escaped in
library/src/dotty/Show.scala
forstringShow
andcharShow
.