Re: [PHP-DEV] Discussion: String streams

2022-03-21 Thread Larry Garfield
On Mon, Mar 21, 2022, at 10:23 AM, Sara Golemon wrote: > TL;DR - Yeah, PHP, but what if C++? Feel free to tell me I'm wrong and > should feel bad. THIS IS ONLY IDLE MUSINGS. > > I was reading the arbitrary string interpolation thread (which I have mixed > feelings on, but am generally okay with),

Re: [PHP-DEV] [RFC] Disjunctive Normal Form Types

2022-03-21 Thread Sara Golemon
On Sat, Mar 19, 2022 at 12:15 PM Anton Smirnov wrote: > 1. I think that syntax would be cleaner without the parentheses > > No. https://c.tenor.com/zM15ZrNYp0QM/no-michael-scott.gif Grouping is never cleaner without parenthesis than it is with them. The actual proposal? Yes. DNF types as t

[PHP-DEV] Discussion: String streams

2022-03-21 Thread Sara Golemon
TL;DR - Yeah, PHP, but what if C++? Feel free to tell me I'm wrong and should feel bad. THIS IS ONLY IDLE MUSINGS. I was reading the arbitrary string interpolation thread (which I have mixed feelings on, but am generally okay with), and it got me thinking about motivations for it and other ways

Re: [PHP-DEV] [RFC][Under discussion] Arbitrary string interpolation

2022-03-21 Thread Rowan Tommins
On 21/03/2022 10:27, Robert Landers wrote: > The downside of a prefix is that it isn't backwards compatible. You could use # in a suffix so if you need to write backwards compatible code, you can. So maybe: > > echo "{$x#10.3f}"; > > which can be written like this in backwards compatible code:

Re: [PHP-DEV] [RFC][Under discussion] Arbitrary string interpolation

2022-03-21 Thread Robert Landers
On Mon, Mar 21, 2022 at 10:51 AM Rowan Tommins wrote: > On 20/03/2022 13:39, Rowan Tommins wrote: > > Using a second colon would make ternary expressions slightly awkward; > > C# handles this by requiring them to be parenthesised, so "{$:( $test > > ? $x : $y )}" would be valid but "{$:$test ? $x

Re: [PHP-DEV] [RFC][Under discussion] Arbitrary string interpolation

2022-03-21 Thread Rowan Tommins
On 20/03/2022 13:39, Rowan Tommins wrote: Using a second colon would make ternary expressions slightly awkward; C# handles this by requiring them to be parenthesised, so "{$:( $test ? $x : $y )}" would be valid but "{$:$test ? $x : $y}" would not; we could use some other delimiter, but they'd p