lua-users home
lua-l archive

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




I would doubt that using varargs as a Forth stack is the best approach. What’s wrong with a Lua array (aka table)?
Lua arrays can't do nil, Lua stacks can.

Well, it’s true that a “true” Lua array (a sequence) cannot contain a nil value, but if you maintain your own top-of-stack (aka array size), then there is no reason why you cannot have nil as the value of some elements…

t = { “a”, “b”, “c” }
t.len = 3
t[2] = nil

—Tim