[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Quest: real world "Lua array with holes" usage
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Thu, 21 Jul 2016 19:08:26 -0300
> The first use case that came to mind was JSON deserializers, where the
> obvious mapping of null to nil causes problems with arrays.
That's the whole point: one probably shouldn't not force the semantics
of one language into another. In this case, and others, it's simpler
and clearer to define
null = {}
once and use it where needed. if you must skip over these when traversing
a table, then that's what your semantics dictates and you must do it.
Just do not try to do this with nil, which has its own, clear semantics
in Lua.