-
Notifications
You must be signed in to change notification settings - Fork 161
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
IS Operator for IS BLANK or IS NOT BLANK #18
Comments
The language is roughly modeled around the Excel formula language, so I would expect it to look more like |
Thanks. Good to know. I like the IS_BLANK(variable) syntax. I'll give that a try. I was originally using SQL-like syntax so the expression could be used against a hash or a database. |
This is my test function for testing an empty variable but it doesn't accept nil values. I'm using the :non_group signature to accept any type of variable but it's not accepting nil. c.add_function(
name: :blank,
type: :logical,
signature: [:non_group],
body: ->(var) {
return (var.to_s.strip.empty?)
}
)
|
c.evaluate("BLANK(foo)", foo: nil) |
I would like support for an "IS operator where I can do "IS BLANK" or "IS NOT BLANK" to see if a particular value exists or not. In my own expression evaluator I'm using Object#blank? and Object#present? from Rails to check this condition.
Is this something you'd be willing to add or accept a PR for?
The text was updated successfully, but these errors were encountered: