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
Minor evaluation issue regarding update operators #97
Comments
Why? |
Because |
Also, there's a convention within macro-like systems (of which moonscript is one) that expressions should be evaluated only as many times as they are written. For example, python's neat a < b < c syntax (which is basically a macro, albeit a language level one, in that it is a syntactic shortcut) is not exactly equivalent to a < b and b < c because |
Again, this is very minor. It's a small detail, and it doesn't really matter if it's addressed. I just thought it would be worthwhile to bring it up because there are situations where it makes a noticeable difference which form it the update compiles to. |
Ah, I posted my question before you edited your post :) Yeah, for multidimensional it's handy. But for single- it can theoretically bring some overhead (copying numbers?), so better use it only for multidimensional |
Yeah this is definitely a bug. I'd like to fix this. |
compiles to
although it should be
My intuition tells me that, in addition to other "principle of least surprise advantages", this would improve efficiency for situations such as
The text was updated successfully, but these errors were encountered: