meander

All things about https://github.com/noprompt/meander Need help and no one responded? Feel free to ping @U5K8NTHEZ
yuhan 2020-01-05T03:51:20.250700Z

Perhaps if you pre-processed the sequence to add a leading and trailing zero, then extracted all "between-zero" subsequences?

yuhan 2020-01-05T03:52:43.251200Z

(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))

aisamu 2020-01-05T22:00:47.277500Z

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[])

aisamu 2020-01-06T12:20:07.282700Z

NP, thanks! Would love to know what the correct result is, though!

noprompt 2020-01-06T19:51:32.283600Z

It should be ([:a] [:b]).

noprompt 2020-01-06T19:52:25.283800Z

Oh, sorry, no, it should just be (:a :b).

noprompt 2020-01-06T19:52:44.284Z

So the #fail there is the only problem.

đź‘Ś 1
noprompt 2020-01-06T19:58:37.285400Z

Fixed

🎉 1
jimmy 2020-01-05T22:08:52.279400Z

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.

noprompt 2020-01-05T23:13:38.280200Z

This one is likely a bug. That fail shouldn’t be there.

đź‘Ť 1
noprompt 2020-01-05T23:21:14.281600Z

Also the result itself is wrong.

noprompt 2020-01-05T23:22:18.282500Z

I’m on the road and can’t look at this until later.