lua-users home
lua-l archive

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




On 2020-02-28 10:10 p.m., Soni "They/Them" L. wrote:


On 2020-02-28 10:05 p.m., Egor Skriptunoff wrote:
On Sat, Feb 29, 2020 at 12:59 AM Anton Jordaan wrote:

    If I want to access the value of t[a][b][c][d][e]

    I suggest that it would be more useful -- and more consistent --
    if the
    "Attempt to index a nil value" error is deprecated and, instead, the
    indexing of undefined variables does the following:

    When reading: simply return nil.



http://lua-users.org/lists/lua-l/2017-02/msg00308.html
See solution #3


    When writing: automatically assign a single-entry table to each
    undefined variable, with the given index the sole entry.


Creating a table would better be explicit.

mktable -p (table, a, b, c, d, e, f, g, ...).with = value

(this is valid lua fwiw, but good luck making it work :v)

correction, this is valid lua:

(mktable -p (table, a, b, c, d, e, f, g, ...)).with = value

oh well .-.