Missing python-like chaining in D

Dom DiSc dominikus at scherkl.de
Tue Feb 22 14:33:29 UTC 2022


On Tuesday, 22 February 2022 at 14:23:19 UTC, Paul Backus wrote:
> On Tuesday, 22 February 2022 at 14:13:38 UTC, Dom DiSc wrote:
>> it means: eval each operator separately, then AND all the 
>> resulting booleans together and call that the result.
>
> As far as I can tell Python does not actually evaluate the 
> middle operand twice. Instead, it evaluates it once and stores 
> the result in a temporary.

Ok, so this can be implemented in a logical way, but still is 
something completely different from what C does (which was 
complete nonsense), so the rule still applies: don't silently 
change the meaning of some code!


More information about the Digitalmars-d mailing list