lua-users home
lua-l archive

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




On Saturday, February 22, 2014, steve donovan <steve.j.donovan@gmail.com> wrote:
On Sat, Feb 22, 2014 at 3:32 PM, Andrew Starks <andrew.starks@trms.com> wrote:
> If lines was deprecated, an option *could* be to add another modifier

Oh no, I use that all the time! It would be like banning dogs because
sometimes they bite children.

 > Something like "read until a specified string of symbols or end of
> file."

And that would be very do-able as a useful C extension

steve d.

And could it also serve as a replacement for "lines", which slowly creeps towards ambiguity? It seems as though it'd be quite straight forward to implement and "lines" might be preserved as a call to it. This is pretty close to earlier suggestions such as "while c ~= '\n'" but provides for other matches. 

I don't want to be the guy that advocates for banning dogs, though. It just seems that "lines" doesn't deserve the elevated status it enjoys, when a simple and more general alternative could serve as well and be more robust. It would be slower, but I doubt it would show up as significant in an application that does real work.