Endow operators '?' ':' '??' code branching functionality #7948
Replies: 3 comments 8 replies
-
Could you provide example code of what you're describing, before and after applying these operators? I don't really understand what it is that you're asking. |
Beta Was this translation helpful? Give feedback.
-
It may be useful to add real life example where this feature might be used but the alternative or workaround is cumbersome to a point this feature is justified because throwing some arbitrary syntax without explaining the semantics and say "I want this" doesn't help much. Personally I can't see the benefit. |
Beta Was this translation helpful? Give feedback.
-
@iam3yal This is not a matter of personal preference, it is a matter of generalization of syntax. This is the general trend. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Endow operators '?' ':' '??' code branching functionality, if they are combined with code blocks delimited with curly braces '{' '}'
in the general case or one unary code unit where the code parser allows;
As an example, in your code, try replacing the 'if' 'then' 'else' conditional operators and the null check in accordance with the operating logic of '?' ':' '??' .
I think we are already getting close to this.
Addition: In general logic, the '!??' operator may appear as the inverse of '??'.
Beta Was this translation helpful? Give feedback.
All reactions