-
-
Notifications
You must be signed in to change notification settings - Fork 436
support nil value to compare #755
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
@antonmedv any ideas? tks~ |
Well, I 'm now sure if we should add such a feature.
|
I agree with your point about comparing nil with nil. However, regarding comparisons between nil and specific values (like nil > 1), would it be possible for expr to support this to provide a better user experience? Thank you. |
Interesting topic! I have a lot of math with potential nil values in my application and implemented the logic with a patcher. But I think expected results will be application dependent: is nil > 1 false, or nil? To me, nil is not comparable to any value, so nil > nil is false. To be consistent, nil == nil would be false as well! |
@mdmcconnell has a good point. I think it is better to be explicit:
|
please run the example code below:
can
Expr
support>
、>=
、<
、<=
like==
operator? tks~The text was updated successfully, but these errors were encountered: