lua-users home
lua-l archive

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


On Tue, 06 Apr 2010 15:28:41 +0300, Martijn van Buul (Ellips B.V.) <martijn.van.buul@ellips.nl> wrote:

My naive solution would be simple: Iterate over the array, add the
string length of its members, add the required storage for any supplied
separator, allocate the target string to the right, and memcpy() the array members
(and any separators) over to their final location.

This is not supported by the current low-level API. You cannot create string object
without supplying it's contents.
It is possible to implement this, but the change will be quite intrusive
(supporting temporary TString value that is not registered in the global hash) or verbose (calculating hash value of resulting string before allocating it,
adding a 3rd pass over source data).