[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC] More powerful string literals, instead of new format function
From: |
Mohammad-Reza Nabipoor |
Subject: |
Re: [RFC] More powerful string literals, instead of new format function |
Date: |
Sat, 13 Mar 2021 23:27:27 +0330 |
Hi, Jose.
On Fri, Mar 12, 2021 at 11:46:23PM +0100, Jose E. Marchesi wrote:
>
> > I propose a Python-like string literal: f-strings.
>
> I am not convinced at all about this.
>
Thank you for your comprehensive review.
I realized that I missed two major points in my proposal:
- Nested style-classes
- Future of `printf`
The first one is not simple to achieve using f-strings.
Regarding `printf`, yes, we cannot just remove it from the language.
And having two syntax for doing exactly the same thing (but differently)
is a very bad idea (one using `printf` and the other using f-strings).
So, `format` is the right solution for the Poke.
And the parser would replace a `printf (...)` with `print (format (...))`.
Regards,
Mohammad-Reza