Letting RegExp method return something iterable?

Forbes Lindesay forbes at lindesay.co.uk
Wed Aug 28 16:55:25 PDT 2013


Right, I don't care whether it's lazy.  I only care that it exists.  Nobody's crying out for a lazy version of string split (at least not yet anyway).  I have had the issue of needing to loop over all the matches that a regular expression has.  It is a common, recurring issue that many developers face.

Let's move on from whether it should exist (clearly it should) and stick to whether it should be an array, or lazy.  Does anyone have a strong opinion either way?  The fact that all our regular expression iteration thus far has been lazy to me suggests this probably should be too, but maybe it would be simpler if it returned an array.  I really hope someone will chime in on this.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130828/b7776b10/attachment.html>


More information about the es-discuss mailing list