[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Undefined variables returning nil
- From: William Sumner <prestonsumner@...>
- Date: Tue, 19 Mar 2013 16:32:42 -0600
On Mar 19, 2013, at 4:22 PM, Petite Abeille <petite.abeille@gmail.com> wrote:
>
> On Mar 19, 2013, at 11:05 PM, William Sumner <prestonsumner@me.com> wrote:
>
>> I'm talking about ALL attempted accesses of undefined variables, including table/array/class elements.
>
> Lua has only tables. As shown, you can trap __index and decide what you want to do. It's up to you.
I know Lua only has tables. Because they're used for arrays, classes, and more, catching only undefined globals is insufficient. I'm suggesting that, unless there's a good reason for the current behavior that I'm unaware of, relying on user-implemented solutions is undesirable and that the language should raise an error because the current default behavior is unsafe.
Preston