[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: table.concat - strings and numbers only?
- From: Matthew Wild <mwild1@...>
- Date: Tue, 22 Jun 2010 17:06:12 +0100
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