Skip to content
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

Evaluation order in the LuaJIT implementation? #238

Closed
lukego opened this issue Nov 14, 2016 · 3 comments
Closed

Evaluation order in the LuaJIT implementation? #238

lukego opened this issue Nov 14, 2016 · 3 comments
Labels

Comments

@lukego
Copy link

lukego commented Nov 14, 2016

Does the LuaJIT implementation have a strict evaluation order (e.g. left-to-right or right-to-left) for any of these cases?

  1. Function argument evaluation: foo(X(), Y()).
  2. Multiple assignment: x,y = X(),Y().
  3. Table constructors: {x=X(),y=Y()}.
  4. ... other important situations that I have not thought of?

(I am hoping that I can rely on at least strict left-to-right evaluation of function arguments when working with LuaJIT 2.1.)

@MageSlayer
Copy link

(I am hoping that I can rely on at least strict left-to-right evaluation of function arguments when working with LuaJIT 2.1.)

Personally, I doubt it's a good idea.
See http://lua-users.org/lists/lua-l/2006-06/msg00378.html

@MikePall
Copy link
Member

The evaluation order is undefined.

@lukego
Copy link
Author

lukego commented Nov 15, 2016

Thanks for clarifying!

TurkeyMcMac added a commit to TurkeyMcMac/minetest that referenced this issue Dec 19, 2021
sfan5 pushed a commit to minetest/minetest that referenced this issue Dec 19, 2021
rollerozxa pushed a commit to KetchupLand/minetest that referenced this issue Dec 19, 2021
LoneWolfBT pushed a commit to MT-CTF/minetest that referenced this issue Feb 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants