Perhaps if you pre-processed the sequence to add a leading and trailing zero, then extracted all "between-zero" subsequences?
(let [xs [1 2 3 0 4 5 6 0 7 8 0 9]]
(m/search (concat [0] xs [0])
(_ ... 0 . (m/pred (complement zero?) !part) ... 0 . _ ...)
!part))
This fail[]
caught me off guard. What am I missing?
What could it be trying to match against? (`attempt` doesn't help; trace
is opaque; adding an ?a ?a
clause matches against [:a :b]
but still fails)
((m*/rewrites
(m/scan !entries)
!entries)
[:a :b])
;; => (:a :b #meander.epsilon/fail[])
NP, thanks! Would love to know what the correct result is, though!
It should be ([:a] [:b])
.
Oh, sorry, no, it should just be (:a :b)
.
So the #fail
there is the only problem.
Fixed
I'll admit that is a bit counterintuitive. But rewrites (epsecially in strategies) is not something I've used a ton. Sadly I probably won't have time to look into it tonight but can tomorrow if no one else does.
This one is likely a bug. That fail shouldn’t be there.
Also the result itself is wrong.
I’m on the road and can’t look at this until later.