Do you think if statement as expression would be nice to have in D?

Salih Dincer salihdb at hotmail.com
Mon Jun 6 14:30:28 UTC 2022


On Saturday, 4 June 2022 at 22:21:12 UTC, Ola Fosheim Grøstad 
wrote:
> On Saturday, 4 June 2022 at 22:05:36 UTC, JN wrote:
>> I like the Python version of it with is reordered compared to 
>> Rust/D:
>>
>> num_type = "even" if a % 2 = 0 else "odd"
>
> Yes, this is one is working well when the leftmost is the most 
> common case and the right one is a fallback.

It is so far ahead of the D era that it needs to be focused on...

For example (int i = 123_456_789;), the D feature that comes in 
ES12 has been there for years, but still no async/await in ES7! 
Anyway, will these features come one day?
> &&=
> ||=
> ??=

**Source:** 
https://www.pullrequest.com/blog/javascript-es2021-you-need-to-see-these-es12-features/


More information about the Digitalmars-d mailing list