[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Undefined variables returning nil
- From: Petite Abeille <petite.abeille@...>
- Date: Wed, 20 Mar 2013 00:37:55 +0100
On Mar 20, 2013, at 12:16 AM, William Sumner <prestonsumner@me.com> wrote:
> but in case you misunderstood me, silently getting nil back when accessing a non-existent table element is unsafe
Hmmm… this is a feature though. There is nothing wrong with accessing a key which doesn't exist. Table access has nothing to say about 'safety'.
On the other hand… are you a Python person perhaps? Looking for something like KeyError? If so, it's trivial to implement your own.
So, as mentioned, feel free to shape your own Lua whichever way you see fit.