lua-users home
lua-l archive

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


> >>But then we could ask the very same question about table.concat, which
> >>also doesn't use tostring...
> >Why should it?
> Because it would be convenient. Are there any reasons for tostring()
> not to be called in these 2 cases?

Robustness? Several errors (e.g., a nil value) will be silently
supressed by 'tostring'. For '%s' this is not such a problem, as usually
we see the result, so it is easy to spot bugs. In table.concat, however,
it may cause some pain for debugging.

-- Roberto