Re:C++23: The Next C++ Standard
by coldtea on Tuesday July 11, 2023 @01:12PM
(#36683999)
std::string formatted_str = std::format(
"My name is {} and my favorite number is {}", name,
num);
[ Parent
| on HN ]
That's really nothing like python strings, which for the same string would be
formatted_str = f"My name is {name} and my favorite number is {num}"
The function call I could forgive, but the the ability to embed arbitrary python expressions into the f-string directly is a huge readability win IMO.
Re:C++23: The Next C++ Standard
by interroboink on Tuesday July 11, 2023 @01:41PM
(#36684488)
Meanwhile Perl's over here like "we had this in the 90s!" (:
Of course posix shells gad that even before. How far we can go? What's the first language that had something that resembles string interpolation?
Re:C++23: The Next C++ Standard
by interroboink on Tuesday July 11, 2023 @02:55PM
(#36685643)
I'm sure someone here can say something about Lisp machines (:
Well, if that's the syntax, I'd rather not have it!