lua-users home
lua-l archive

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


On Wed, Jun 25, 2014 at 8:01 AM, Thomas Jericke <tjericke@indel.ch> wrote:
> On 06/24/2014 11:49 PM, Pierre-Yves Gérardy wrote:
>>
>> It works around an "yield across C boundary" issue when using the
>> MoonScript loader with OpenResty. The first resumes a coroutine at
>> parse time, and the latter runs request handlers in coroutines.
>> Requiring a MoonScript file from a handler breaks because of this,
>> since `require()` is a C function.
>
> You can patch "require" in Lua 5.2 to have a continuation function.
> If you wan't to I'll try to extract it from my sources.

Thank you, but I wrote this for LuaJIT/OpenResty, and I'd rather not
change the C source. require52 really is yak shaving :-)

—Pierre-Yves