From 5142428c3a08ca623b5aa99e1c2f3526fc144b29 Mon Sep 17 00:00:00 2001 From: Rafal Kupiec Date: Thu, 16 May 2019 12:31:36 +0200 Subject: [PATCH] Update page 'Future AerScript Versions' --- Future-AerScript-Versions.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Future-AerScript-Versions.md b/Future-AerScript-Versions.md index 0c17873..42f596f 100644 --- a/Future-AerScript-Versions.md +++ b/Future-AerScript-Versions.md @@ -40,6 +40,16 @@ The is operator could be used to check if the run-time type of an object is comp } } +### NULL coalescing operator +The ___??___ operator should return the left side as long as it's not null, in that case the right side would be returned. + + int function() { + $someValue = $this->GetValue(); + $defaultValue = 23; + //result will be 23 if $someValue is NULL + return $someValue ?? $defaultValue; + } + ### Operator overloading It should be possible to redeclare or overload most of the built-in operators available in AerScript. Thus a programmer could use operators with user-defined object types as well. Overloaded operators are functions with special names the keyword operator followed by the symbol for the operator being defined. similar to any other function, an overloaded operator has a return type and a parameter list.