lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Wed, Feb 16, 2011 at 1:24 PM, Julien Duminil
<julien.duminil@ubisoft.com> wrote:
> Maybe we could add an error/custom message to every nil variable.
> Plus, add of a function reason(nil_var) that give the message.

It is quite attractive, as long as it isn't the dreaded errno which
has caused mischief in multi-threaded C programs. (One could make that
work in regular Lua provided the message was per-state)

Otherwise, suddenly there are a lot of different nils ....

I'm intrigued by the Go solution pointed out by Jim earlier:

val, reason := map["key"];

Again, one could ignore the extra value (although the implicit unpack
at end of table ctor or function call will cause its share of
problems)

steve d.