lua-users home
lua-l archive

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


for i, v in pairs(args.optional_table or {}) do

If the "or {}" is triggered, is it gc'd in the same way as all other
garbage, or is there some kind of optimization that makes this

Second example:

local function my_func(args)
    local first, second = args.arg1, args.arg2
    print(first, second)

my_func{arg1 = "hello", arg2 = "world"}

Again, the anonymous table is assigned to args, but args is never
assigned and it's never passed as an argument to something else.

Is it treated differently in collection or is "garbage garbage."?