[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: `require()` semantics?
- From: Thomas Jericke <tjericke@...>
- Date: Wed, 25 Jun 2014 08:01:55 +0200
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.