Idea

Mischa Spelt avatar image
2 Likes"
Mischa Spelt suggested

Add null coalescing operator

The "question mark" operator is really useful for those cases where you're not sure a label exists, for example. But I often find myself writing expressions like

(token.MayExist?) ? token.MayExist : defaultValue

C# has the null coalescing operator "??" (and C++ has a GNU extension where this exists as "?:") which would simplify this to

token.MayExist ?? 0

Just throwing it out here as an idea. As a bonus, C# also has the null coalescing assignment operator which allows you to do

token.WillExist ??= 0 
// shorthand for: token.WillExist = (token.WillExist ?? 0);


flexscriptnull variant
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

No Comments

·

Write a Comment

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Your Opinion Counts

Share your great idea, or help out by voting for other people's ideas.