lua-users home
lua-l archive

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

 > >instead of looking at a file as a sequence of lines,
 > >let's generalize to allow arbitrary regular expressions
 > >to mark boundaries between units.
 > Isn't this the sort of string library function which many languages offer 
 > under a name such as "split"? Break a string into fields separated by some 
 > (possibly non-trivial) pattern (default usually something like '[ \t]*')?
 > If so, I would welcome the addition of a split()-like method to the 
 > standard string strikes me as one of those 'feature creeps' 
 > which would be sufficiently small (given that it could reuse much existing 
 > matching code, as you show here) but sufficiently widely and commonly used 
 > as to be, well...useful.

I'd be happy to have 'split'.  The Lua team would probably have to
work a little harder to avoid duplicating code inside lstrlib.c, but
probably not too hard...