lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


For Lua 5.1 and 5.2, https://github.com/pygy/require.lua does the same
in plain Lua, no patch required.

    require = require'require'.require

and you're ready to go

I haven't kept up with Lua 5.3 though, and I don't know if the
`require()` differs from v5.2.

if it doesn't replace the line above with (in Lua 5.3)

    require = require('require').require52


—Pierre-Yves


On Mon, May 15, 2017 at 4:13 PM, Daurnimator <quae@daurnimator.com> wrote:
> I encountered a situation where an asynchronous 'require' was desired;
> here is a patch to allow require to yield:
> https://github.com/lua/lua/compare/master...daurnimator:yieldable-require
>