lua-users home
lua-l archive

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


On 7 November 2015 at 14:42, Marco Atzori <marco.atzori.1983@gmail.com> wrote:
> I created various functions for string manipulation in Lua, where the
> strings are composed of tokens separated by an ASCII character (which may be
> the point, comma, semicolon etc.). Two of these are the functions numtok()
> and gettok(). Here is the code: http://nopaste.linux-dev.org/?824658

This code is really complex and inefficient. Are there reasons you are
doing it like this? Why can't you use tables?

If you have actual constraints, revealing them might allow people to
help you better. If you don't have any constraints and just want it to
perform well, then there are some really much simpler and more
efficient solutions than your implementation.

Regards,
Matthew