Missing python-like chaining in D

0xEAB desisma at heidel.beer
Fri Feb 25 14:02:20 UTC 2022


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


More information about the Digitalmars-d mailing list