MightyPirates / OpenComputers

Home of the OpenComputers mod for Minecraft.
https://oc.cil.li
Other
1.59k stars 431 forks source link

LuaJ doesn't call user defined metamethods __pairs nor __ipairs #1735

Closed payonel closed 8 years ago

payonel commented 8 years ago

It appears that tab completion does not work in the lua prompt on LuaJ archs, and further investigation finds that the reason is because the environment is failing to supply a list of available keywords -- and the reason appears to be that user defined ipairs and pairs metamethods are NOT called (len and index are). I have not tested other metamethods.

fnuecke commented 8 years ago

Paging LuaJ master @gamax92.

dgelessus commented 8 years ago

I think __ipairs is deprecated since Lua 5.3, because ipairs now respects __index. __pairs isn't though.

payonel commented 8 years ago

Without looking it up, I'll agree that sounds familiar :) I felt it worth noting that the tab-completion bug needs pairs fixed, not ipairs.