lua-users home
lua-l archive

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


On Thu, Jul 14, 2016 at 11:45 AM, Soni L. <fakedme@gmail.com> wrote:
>
>
> On 14/07/16 12:37 PM, Patrick Donnelly wrote:
>>
>> 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).
>>
> Amazingly, linked lists are O(1).

Okay, let me be more clear*: Bullshit. Link to your "sane Lua
implementation". Come on, let's see it. To my knowledge, no Lua
implementation uses linked lists for the function stack (not call
stack) and, even if they did, it wouldn't be useful anyway when
copying groups of values between coroutines.

* You know, your snide remarks don't help you at all here. There are
smart people on this list and if someone doesn't understand, it's
probably not because they're stupid. Maybe you just need to do a
better communicating what you know/think.

-- 
Patrick Donnelly