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

Fix support to lua5.1, lua5.2 and luajit #1

Open
italomaia opened this issue Mar 19, 2019 · 2 comments
Open

Fix support to lua5.1, lua5.2 and luajit #1

italomaia opened this issue Mar 19, 2019 · 2 comments

Comments

@italomaia
Copy link
Owner

Just noticed some tests break for lua5.1, lua5.2 and luajit. Trying to cook up proper fix.

@imolein
Copy link
Contributor

imolein commented Oct 7, 2019

I took a look why the tests are failing, but I don't know how difficult it is to fix them.

The following tests break in lua5.1 and lua5.2 because until lua5.3 the table library don't respect metamethods for getting and settings elements (see lua 5.3 manual). So table.insert don't invoke the __newindex metamethod:

  • immutable output is as expected gives an error on table insert
  • immutable output is as expected gives an error on table remove
  • proxy creates expected behavior newindex is always called
  • set output is as expected doesn't add repetead values

And the followings tests break in lua5.1 because of the lack of __pairs:

  • proxy creates expected behavior allows to protect value set
  • set output is as expected removes repeated values
  • set output is as expected doesn't add repetead values

@italomaia
Copy link
Owner Author

italomaia commented Oct 8, 2019

This is quite a nice sumary of the issue @imolein
So, we have two problems, with different levels of complexity, here that could be solved separately.
For problem 1, patching table functions could probably solve the issue, although this is probably far from trivial. Might also not work with luajit (maybeeeeee). (I say this but have no clue how to do it).
For problem 2, would you like to propose a solution? Just adding a __pairs method made it work for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants