[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Request for 5.4: adding [] as table creation syntax for Lua 6.0
- From: Patrick Donnelly <batrick@...>
- Date: Thu, 14 Jul 2016 11:37:06 -0400
On Thu, Jul 14, 2016 at 11:14 AM, Soni L. <fakedme@gmail.com> wrote:
> That's only true for PUC Lua. That is,
>
> local function array(...)
> local function arrayco(...)
> while true do coroutine.yield(...) end
> end
> local co = coroutine.wrap(arrayco)
> co(...)
> return co
> end
>
> is usable in sane Lua implementations. Stop using the PUC Lua interpreter
> and you won't have any more complaints about this stuff.
Uh, are you suggesting that the above array function is O(1) in "sane
Lua implementations" (are you implying LuaJIT???). I'd love to see
the Lua interpreter that "optimizes" lua_xmove across coroutines to
O(1).
--
Patrick Donnelly