[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Check for ipairs() compat mode
- From: Dirk Laurie <dirk.laurie@...>
- Date: Thu, 19 Jul 2018 09:49:30 +0200
2018-07-19 1:52 GMT+02:00 <tobias@justdreams.de>:
> I guess I can shorten it to the minimum but it's still clumsy:
>
> local t = setmetatable( {},{__ipairs=function(tbl) return function() return
> nil,nil,true end,tbl,0 end})
>
> local a,b,c = ipairs(t)
> local _,_,_isCompat = a(b,c)
I replied to the first post before reading this one. Here you do have an
example. This example runs perfectly for me in both Lua 5.3 and 5.4.
But maybe it is a simpler case than the one on which you observed
the offending behaviour.