[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] Haxe Lua : compile Lua/LuaJIT script from Haxe 3.3
- From: Javier Guerra Giraldez <javier@...>
- Date: Tue, 31 May 2016 09:19:36 +0100
On 31 May 2016 at 05:42, Justin Donaldson <jdonaldson@gmail.com> wrote:
> it needs to track its length in order to accommodate nil values
The usual approach to store nil values in a table is to use your own
'pseudo nil' value.
------
local mynil = {}
function set(t,k,v)
if v == nil then v = mynil end
t[k] = v
end
function get(t,k)
local v = t[k]
if v == mynil then v = nil end
return v
end
-------
--
Javier