You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here is the case, I want to implement a proxy for array in luajit environment with __index and __newindex that read write data in another table.
However, luajit which is lua5.1 doesn't support __len__ipair metamethod, and length operator #, global next function, global ipairs function would return wrong result on proxy.
Then I come up with an idea that write a printer plugin that print #nextipairs into some custom implementation, but this plugin would ignore code in lualib.
I think the problem is, the plugin doesn't give user enough power to modify the compilation process, since lualib are already compiled before plugin taking over.
The text was updated successfully, but these errors were encountered:
Sounds like this is a duplicate of #973, I still think this would be a good idea to do. However, the design is not yet clear to me, and we need to decide on what the interface for this should be.
Yes this is a duplicate, and sorry I didn't check it.
Currently, lualib are already precompiled into lua code and package in the npm package.
On user compile time, lualib just skip the compiling and use the precompiled code, and I know it is for performance reason.
What I am hoping is, there is an option to choose using precompiled lualib or not, so that the lualib code can be recompiled with user's plugin if user choose not to use precompiled code. Of course, those lualib ts source code should also be published to npm.
For example, we have code array.length compiled into #array. Now I have a plugin modify it into Len(array), and I implement this global Len function so I can call the __len metamethod if it exist.
Thus, those # length operator in lualib_bundle.lua, should also be recompiled to use Len since this is user expect.
Here is the case, I want to implement a proxy for array in luajit environment with
__index
and__newindex
that read write data in another table.However, luajit which is lua5.1 doesn't support
__len
__ipair
metamethod, and length operator#
, globalnext
function, globalipairs
function would return wrong result on proxy.Then I come up with an idea that write a printer plugin that print
#
next
ipairs
into some custom implementation, but this plugin would ignore code in lualib.I think the problem is, the plugin doesn't give user enough power to modify the compilation process, since lualib are already compiled before plugin taking over.
The text was updated successfully, but these errors were encountered: