[Date Prev][Date Next][Thread Prev][Thread Next]
- 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: email@example.com [mailto:firstname.lastname@example.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)
> > 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?
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.