Sysop: | Amessyroom |
---|---|
Location: | Fayetteville, NC |
Users: | 28 |
Nodes: | 6 (0 / 6) |
Uptime: | 43:30:29 |
Calls: | 422 |
Calls today: | 1 |
Files: | 1,024 |
Messages: | 90,181 |
I'm using CL-PPCRE, and some functions return lists of start and end matches, so a return might be
(0 2 4 7 10 15), three matches.
Right now I loop over the matches like
(loop :for match :on (all-matches scanner text :start start) :by
#'cddr
:do (let ((start (first match))
(end (second match)))
(subseq text start end))
Is there a nicer way to gather the pairs than that?
LOOP destructures. Try this:
(loop for (start end) on (all-matches ...) by #'cddr do ...)