-
Notifications
You must be signed in to change notification settings - Fork 3
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
String Interpolation #34
Conversation
Great RFC! Unfortunately I think the current situation doesnt leave too much wiggle room for alternatives here: A string like:
cannot really work right now. At runtime, we want to represent the string as compact as possible, a nice little continuous string would the the best option for performance reasons. In the resulting formatted string, we intend Lets look at this:
What this transforms into in the AST is:
This will obviously fail, as there is only additional argument to the inner To make this work as intended the string would need to look like:
Whereas when no interpolation is used, the above raises a runtime error as the number of placeholders and arguments does not match. It needs to be written as:
Having to use different escaping levels depending on whether interpolation is used or not, is not acceptable. I think the only way to overcome this, is to use option 2. or 3. in the RFC.
Thus, i would vote for adding a prefix like |
bf4cde0
to
c8871fe
Compare
Very good point. And I think you're right. I expanded on the prior art section and added a conclusion section to reflect that input. |
Signed-off-by: Heinz N. Gies <heinz@licenser.net>
Signed-off-by: Heinz N. Gies <heinz@licenser.net>
Signed-off-by: Heinz N. Gies <heinz@licenser.net>
c8871fe
to
85a3ef2
Compare
Rendered