Re: C API - lua_next traversal of "array" table
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: C API - lua_next traversal of "array" table
- From: Daurnimator <quae@...>
- Date: 2016年8月20日 16:56:26 +1000
On 20 August 2016 at 16:40, ThePhD <jm3689@columbia.edu> wrote:
> As another side note, has there ever been consideration for a better "key
> detection" function? For example, lua_gettable returning the `none` type if
> the requested key doesn't exist, but still pushing `nil`, so that people
> could differentiate between the presence of a nil value mapped to a key
> versus a non-existent key?
A "missing" key *is* a value of nil. there is no difference. (unlike
in JS where you can assign `undefined` which is treated differently to
the `delete` operator)