lua-users home
lua-l archive

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


On Thu, Dec 02, 2010 at 12:02:52AM +0200, Peter Odding wrote:
> > IMHO this can easily be achieved with gmatch.
> 
> Right. I wasn't proposing these be added to the standard library, I just 
> wanted to share some useful code with Dirk, since as he said it's tricky 
> to get right.
> 
But I did propose that some sort of string splitting be made standard.
The Lua string routines are not minimal: you can do gfind, match, 
gmatch in Lua if you have find; you can do find and gsub in Lua if 
you have sub; you can do sub in Lua if you have byte and char.  

Should not the criteria for admitting a new routine to the standard 
library be: 
(a) you can't do it purely in Lua, or
(b1) you can, but it is inefficient, and
(b2) the task is a very common one.

Dirk