Missing python-like chaining in D

forkit forkit at gmail.com
Wed Feb 23 08:47:56 UTC 2022


On Wednesday, 23 February 2022 at 08:34:07 UTC, bauss wrote:
> On Wednesday, 23 February 2022 at 08:12:52 UTC, forkit wrote:
>> On Wednesday, 23 February 2022 at 04:27:37 UTC, Walter Bright 
>> wrote:
>>>
>>> ... D's behavior here been universally approved of. I 
>>> originally thought with the size of this thread that people 
>>> were going to want to change it, and am glad I was wrong.
>>
>> That people don't want it in D, is fine. I have no problem 
>> with that.
>>
>> But you assertion is not correct:
>>
>> https://docs.julialang.org/en/v1/manual/mathematical-operations/#Chaining-comparisons
>
> Programming isn't always 1:1 to mathematics.

Nobody has made that argument.

I just like the idea of being able to express:

i < n && n < x

in a mathmatically concise manner:

i < n < x

As with a lot of syntax in programming languages, of course it 
can be misused, and it also may require mental effort to master.

btw. C is no stranger to the concept of 'conciseness' ;-)



More information about the Digitalmars-d mailing list