-
Notifications
You must be signed in to change notification settings - Fork 31
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
Bad OR behaviours #21
Comments
Another case where we should be following traditional lisp semantics. Just in case: The same goes for IF, AND, COND, etc. so if we have those and they don't already to this, make sure they do (though I believe IF already follows this). Also, check out this xkcd for some real insight: http://m.xkcd.com/870/. |
The issue here is that PHP doesn't seem to natively support this behavior for its logical operators. I guess the solution would be to convert them to ternary statements but I'm not sure if there'd be a performance penalty. Ideally there shouldn't be, but the PHP internals can be rather messy. |
Doesn't the
to:
|
Yep, I just wasn't sure if PHP would add some extra overhead to if statements. Some quick benchmarks show that if statements were as fast as ternary statements. I really need to stop irrationally fearing PHP internals :) Implementing this now. |
(or FALSE "string") should return "string" but returns 1.
It always returns 0 or 1, but should return 0 (FALSE) or the element that was not FALSE, so to make possible to use something like (print (or variable "default string")).
The text was updated successfully, but these errors were encountered: