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
Make coerceTo("BOOL") work on all types? #3133
Comments
Making things consistent with the behavior of Making something smarter for numbers seems dangerous. It looks like a first step to what JavaScript does when |
+1 for neumino's proposal, Javascript falsy sux :) |
For strings, arrays, and objects I'm in favour of a Python inspired solution where it's essentially based on the length:
|
I think consistency with |
I'm sold for variant 2, consistency with It seems that while we could make a "smart" behavior consistent with some language, it would always be inconsistent with many others. In the end it seems like it will just behave unexpectedly for most users. |
I agree we should go for consistency with |
I'm not sold on how |
Marking as settled for making |
Fixed by @eliangidoni in |
Currently we have:
It seems that
coerceTo('BOOL')
basically doesn't do anything at all. Is that correct?Here are three options of what we could do about it:
r.branch(x, true, false)
, i.e.'3. Try to be a bit "smarter" with respect to numbers and strings:
The text was updated successfully, but these errors were encountered: