lua-users home
lua-l archive

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


Hello,
i have callback system where user registers own function. Some of these functions do not return anything. I was expecting i can handle this condition as nil. but apparently that is not the case. any ideas how can i handle this situation?

function a(); return nil; end;
a
function: 0xaaab070bfaf0
a()
nil
tostring(nil)
nil
tostring(a())
nil
function b(); end;
b
function: 0xaaab070c0de0
b()
tostring(nil)
nil
tostring(b())
stdin:1: bad argument #1 to 'tostring' (value expected)
stack traceback:
	[C]: in function 'tostring'
	stdin:1: in main chunk
	[C]: in ?


--
S pozdravem
Best regards
     Tomáš Mudruňka - SPOJE.NET s.r.o.