You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For example, Python has f"foo is: {foo}". Something like this would be easy to implement; it could just be translated into a String.builder() call. I think the biggest decision would be what syntax to use.
The text was updated successfully, but these errors were encountered:
Any expression should be allowed within a substitution block. This means that symmetric delimiters for substitution blocks that can also be used in expressions (e.g., `, |) must not be used.
The open delimiter for a substitution block should be escapable within the string, but should also be uncommon in strings. No need to make it multi-character (e.g., #{foo} in Ruby) if the start can just be escaped if needed.
Indicating a format string by prefixing the opening " should also be usable for raw strings later on if added, and shouldn't seem "weird" given other uses of the prefix. For example, probably not \"..." or @"...".
Some possibilities:
$"foo is: {foo}", $"Bar is: { Bar{ 123 } }"
#"foo is: {foo}", #"Bar is: { Bar{ 123 } }"
%"foo is: {foo}", %"Bar is: { Bar{ 123 } }"
% might actually be the best option, since it's used in C format strings, and it isn't already being parsed as a unary operator. Note that %"foo is: %{foo}" might be confusing though, because it seems like %{foo} could refer to a param passed to the formatter.
For example, Python has
f"foo is: {foo}"
. Something like this would be easy to implement; it could just be translated into aString.builder()
call. I think the biggest decision would be what syntax to use.The text was updated successfully, but these errors were encountered: