-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Support formatted string literals #1811
Comments
Duplicate of #1801 |
Reading again, I think this is actually a question about formatted string literals, not |
This is called "string interpolation". Most languages require you to specify this explicitly (using a prefix symbol like |
I'm generally very positive about string interpolation or f-strings etc. However, I don't think this is a meaningful issue for leads at this point? We would need a proposal to consider actually adding them. Maybe the question for leads is "are there any fundamental objections or concerns already known without a specific design that would make it not worthwhile to work on a proposal for adding formatted string literals or string interpolation features?" I think the answer to that is "no", but will let other leads confirm. (Generally, I also don't think it is necessary for folks to ask this as a question for leads before starting work on a proposal. More useful in my experience is to discuss it on Discord and the forums to collect any concerns the community might have and incorporate those into the eventual proposal.) |
I agree with @chandlerc -- I see no concerns with adding this kind of feature, and it seems like useful functionality to support. We'll need to see a specific proposal that explores the design details in order to deliver useful feedback beyond that. |
Is it useful to keep an issue for leads here though? There doesn't seem to be anything for us to say "yes" or "no" or ... to? |
Filed #2005 to track the need for a proposal in this space. |
Also closing the issue for now. We can always re-open it if some aspect of the proposal ends up having concerns or controversy. |
Why is the default #print function working in this why:
Instated of the formatted Python string or the Swift print function:
In Python:
In Swift:
In my opinion this represents the future way, and is a lot more intuitive.
If there are no valid reasons for doing so, one should accept this adjustment.
My favoured solution is:
and by default '{' and '}' must be masked by '\', if you want to see them in a string.
The text was updated successfully, but these errors were encountered: