Skip to content

Commit

Permalink
ES6-style escaping: add drawback: overriding {} with format!
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonSapin committed Nov 7, 2014
1 parent 387ed90 commit 65cd08b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions text/0000-es6-unicode-escapes.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,15 @@ The behavior would otherwise be identical.

# Drawbacks

This is a breaking change and updating code for it manually is annoying.
It is however very mechanical, and we could provide scripts to automate it.
* This is a breaking change and updating code for it manually is annoying.
It is however very mechanical, and we could provide scripts to automate it.
* Formatting templates already use curly braces.
Having multiple curly braces pairs in the same strings that have a very
different meaning can be surprising:
`format!("\u{e8}_{e8}", e8 = "é")` is `"è_é"`.
However, there is a precedent of overriding characters:
`\` can start an escape sequence both in the Rust lexer for strings
and in regular expressions.


# Alternatives
Expand Down

0 comments on commit 65cd08b

Please sign in to comment.