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)

It is not just that... Imagine this (nothing prevents you from doing it):

   if (foo < bar < baz < trt < mrt < frt /* etc */) {}

Reply via email to