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

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Mon Jun 6 15:00:43 UTC 2022


On Monday, 6 June 2022 at 14:30:28 UTC, Salih Dincer wrote:
> 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?
>> &&=
>> ||=
>> ??=

Things that makes code *easier* to read is always something any 
language designer should be willing to consider IMO. I guess 
null-specific operators could qualify.

Perhaps there is some generic way to do async/await, so 
developers could use it for custom Promises?  Otherwise 
async/await is sort of out of place in @system, but fits well in 
@safe…

In general it would be nice if high level syntax is interacting 
through protocols so that one can use it for generic programming 
(like for-loops do).





More information about the Digitalmars-d mailing list