On Thursday, 4 September 2014 at 20:03:57 UTC, Nordlöw wrote:
Are there any programming languages that extend the behaviour of comparison operators to allow expressions such as

    if (low < value < high)

?

This syntax is currently disallowed by DMD.

I'm aware of the risk of a programmer misinterpreting this as

    if ((low < value) < high)

Is this the reason why no languages (including D allows it).

I'm asking for in some cases, where value is a long expression, it would be a nice syntatic sugar to use.

In the case of D, it's a C compatibility thing. Other languages I don't know.

Reply via email to