Missing python-like chaining in D

Timon Gehr timon.gehr at gmx.ch
Sun Feb 27 02:37:58 UTC 2022


On 25.02.22 15:02, 0xEAB wrote:
> On Tuesday, 22 February 2022 at 08:45:53 UTC, Abdulhaq wrote:
>> It seems you (and most of the people in this thread) have 
>> misunderstood what this is doing in python. 1 < 2 always returns a 
>> boolean, except in the case of operator overloading.
>>
>> 2 < x < 5 is implemented as ```(2 < x) and (x < 5)```, not as ```(2 < 
>> x) < 5```
> 
> So this is whole thing is super ambiguous.
> Glad we don’t have that footgun.
> 
> - Elias

Not ambiguous at all. Not every expression has to be parsed as a binary 
or unary operator...


More information about the Digitalmars-d mailing list