Details
-
Type:
Enhancement
-
Status:
Closed
-
Resolution: Declined
-
Affects Version/s: None
-
Fix Version/s: Backlog
-
Component/s: None
-
Labels:None
-
Approval:Test
Description
This would help concatenating multiple regular expressions. The attached patch simply converts all arguments to a string and then pass that string to re-pattern. Currently if you're trying to concatenate literal regular expressions, you're force to use the str function. It's not much extra code, but given the similarity between re-pattern and str, I thought it would be nice to have them behave the same way. e.g.:
(re-pattern (apply str (map (partial format "%s{%s}") [\a \b \c \d \e] (iterate inc 1))))
would become
(apply re-pattern (map (partial format "%s{%s}") [\a \b \c \d \e] (iterate inc 1)))
It only save one call to str, so it might not warrant the extra code in the end.
Converted from http://www.assembla.com/spaces/clojure/tickets/238
Attachments:
0001-Changed-re-pattern-to-accept-multiple-arguments-to-c.patch - https://www.assembla.com/spaces/clojure/documents/barzR2-Jyr3OGheJe5aVNr/download/barzR2-Jyr3OGheJe5aVNr