lua-users home
lua-l archive

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


>> Do you really want to write tostring() without arguments? What for?

> It is more as a failsafe for this kind of scenario:
> 
>     table.concat{stuff, tostring(foo()), ... }
> 
> where foo is dynamic and may return nothing.

In this case, if you know you have to protect yourself, use
	table.concat{stuff, tostring((foo())), ... }
	
Note the extra pair of parentheses around foo().