Missing python-like chaining in D

12345swordy alexanderheistermann at gmail.com
Wed Feb 23 14:38:10 UTC 2022


On Monday, 21 February 2022 at 09:29:56 UTC, forkit wrote:
> It seems to me, that D is a language where python like chaining 
> would be right at home.
>
> writeln(1 < 2 < 3 < 4 > 3 == 3); // true
>
>
> So why doesn't D have it already ;-)

Why not simply allow this?

writeln(1 < 2 and 2 < 3 and 3 < 4 and 4 > 3 and 3 is equal 3)?

-Alex



More information about the Digitalmars-d mailing list