lua-users home
lua-l archive

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


On 22 June 2010 02:58, David Manura <dm.lua@math2.org> wrote:

> One occurrence is when implementing a __tostring method of a tuple
> ADT, where the tuple is implemented as a table and can contain
> arbitrary values, including nils.  However, for strings I replace that
> tostring(t[i]) with string.format("%q",t[i]) since otherwise strings
> will be indistinguishable from non-strings in the tuple.  This doesn't
> fit into proposal for table.concat supporting __tostring though.
>

I guess there's a case for stopping at the first nil and/or treating
nils as "" for concatenation purposes.

Matthew