lua-users home
lua-l archive

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


> > tostring(b())
> stdin:1: bad argument #1 to 'tostring' (value expected)

You can write tostring( b() or nil), or var=b(); tostring(var), or I
think also use select(#,b()) - which then should give 0 possibly (but
I did not try myself).

... there are quite many nice applications of the fact, that nil and
"none" are different. (C function lua_type also returns LUA_TNONE
(different from LUA_TNIL), and you can easily get the stack count by
lua_gettop... but the type() function I think would NOT return 'none',
presumably type(b(0)) might return 'nil' you have to try...).