lua-users home
lua-l archive

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


2014-08-18 16:35 GMT+02:00 Jan Behrens <jbe-lua-l@public-software-group.org>:

> This just got me to the idea that if ipairs is made to accept
> functions (or even iterator triplets), we could also implement
> a generic concat:
>
> ==================================================
> function string.concat(sep, ...)
>   local t = {}
>   for i, v in ipairs(...) do
>     t[i] = tostring(v)
>   end
>   return table.concat(t, sep)
> end
> ==================================================
...
> Can anyone come up with a real con?

Only that this was proposed two years ago [1] but the Lua team did not bite.

[1] http://lua-users.org/lists/lua-l/2012-07/msg00220.htm