lua-users home
lua-l archive

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


Dirk Laurie <dirk.laurie@gmail.com> wrote:
> For the umpteenth time I find myself copying this code from one program
> into another:
snip
> For the umpteenth time I wonder whether I am the only Lua programmer
> that has ever wished that 'tostring' had an optional second parameter
> allowing one to bypass the __tostring metametod.

I have no real suggestions about getting this method directly into Lua, but
I will say this: please consider bundling it as a rock and adding it to
LuaRocks.

I know it might seem trivial to you now, but rather than cut and paste,
better to have the rock and make it available to everyone else. (I say this
as someone who was persuaded by Pierre and Hisham to share my split code as
a rock[1], and it’s now reasonably popular.)

Best, Peter

[1] https://luarocks.org/modules/telemachus/split

-- 
We have not been faced with the need to satisfy someone else's
requirements, and for this freedom we are grateful.
    Dennis Ritchie and Ken Thompson, The UNIX Time-Sharing System