[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Safe navigation operator
- From: "Juris Kalnins" <juris@...>
- Date: Mon, 23 Aug 2010 16:41:08 +0300
On Mon, 23 Aug 2010 16:20:34 +0300, Cuero Bugot
<cbugot@sierrawireless.com> wrote:
Setting a new value in a table is indeed quite feasible, and the very
reason is that it is easy to know when it is the final access (because
it calls __newindex for the final access). The quite difficult case is
rather to read the table:
i.e. return config.network.server.url would return nil if either
network, or server or url is nil.
Indeed, and I'm sorry I overlooked that.
And it doesn't seem doable, because Lua doesn't have any
"__toboolean" metamethod, nor any other way to virtualize
conversion to boolean value. changing __index /__newindex
doesn't seem to be the right way to fix this.