lua-users home
lua-l archive

Re: Yieldable require

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


On 2017年05月18日 10:20 PM, Daurnimator wrote:
On 19 May 2017 at 02:47, Pierre-Yves Gérardy <pygy79@gmail.com> wrote:
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
Thanks for the link. Good to see someone has made it available for 5.1 and 5.2.
I wrote mine in C to echo the same thing I wrote in JS. See
https://github.com/fengari-lua/fengari/pull/51/files
But I'm also hoping that Roberto may consider adding something similar
in the next major lua release.
I'd rather have yieldable string.gsub personally.
--
Disclaimer: these emails may be made public at any given time, with or without reason. If you don't agree with this, DO NOT REPLY.

AltStyle によって変換されたページ (->オリジナル) /