[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: `require()` semantics?
- From: Pierre-Yves Gérardy <pygy79@...>
- Date: Wed, 25 Jun 2014 09:14:14 +0200
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