[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: protect a set in c (non-existing elements)
- From: Thijs Schreijer <thijs@...>
- Date: Fri, 14 Feb 2014 15:32:22 +0000
> -----Original Message-----
> From: lua-l-bounces@lists.lua.org [mailto:lua-l-bounces@lists.lua.org] 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.
Thijs