lua-users home
lua-l archive

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

> -----Original Message-----
> From: [] On
> Behalf Of Kevin Martin
> Sent: vrijdag 14 februari 2014 15:27
> To: Lua mailing list
> Subject: Re: protect a set in c (non-existing elements)
> Hi,
> > In Lua I would simply protect a set with something like this;
> I don't understand what this protects against? Are you just looking to
> generate a immediate error if the key doesn't exist?
> Thanks,
> Kevin

Exactly, in this case the module table contains 20-25 capitalized constants. So if someone using the module has a typo in his code, I want it to throw an error instead of a silent 'nil' value.