-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compare not existing variables with null #176
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking forward to using this.
Minor suggestions for changes.
@@ -1150,6 +1153,15 @@ object BuiltinFunctions extends FunctionProvider { | |||
} | |||
) | |||
|
|||
private def isDefinedFunction = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Optional) maybe replace it with "is undefined"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about it. I prefer is defined(x)
because it looks more intuitive when inverting it with not(is defined(x))
. Instead of having a double negation not(is undefined(x))
.
src/test/scala/org/camunda/feel/impl/interpreter/InterpreterExpressionTest.scala
Show resolved
Hide resolved
* a not-existing variable or property can be compared with null * new built-in function `is defined()` that returns true if the given value is present (i.e. is not an error)
79711f5
to
c756a18
Compare
@pihme thank you for the fast review 👍 |
* a not-existing variable or property can be compared with null * new built-in function `is defined()` that returns true if the given value is present (i.e. is not an error) (cherry picked from commit 21ef10f)
Description
null
returnstrue
null
returnstrue
if the property isnull
, if it doesn't exist, or if its variable isnull
or doesn't existis defined()
that returnstrue
if the given value is present (i.e. is not an error)Related issues
closes #150