lua-users home
lua-l archive

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


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.