Fork me on GitHub
#meander
<
2021-03-07
>
markaddleman18:03:51

I'm trying epsilon interpreter for the first time. I'm trying to create a searcher function that mimics the behavior of the m/search expression. What am I doing wrong?

markaddleman18:03:20

After doing a bit of source spelunking... Is scan not supported in interpreter?

ribelo18:03:43

you should use the functions available in ns meander.epsilon.interpreter not meander.epsilon

ribelo18:03:02

i would also recommend looking at the test file

ribelo18:03:02

meander develops faster than the documentation is completed

ribelo18:03:34

but the tests are always up to date and cover 100% of what the meander can do

jimmy18:03:50

So I’m not sure I’d go as far as to say that the tests cover 100%. We try our best, but testing and documentation are definitely lacking. There are a few things going on here. First the second argument to searcher is actually function that receives an environment. So you probably want rewriter.

((mi/rewriter '[_ ... ?a . _ ...] '?a) [1])
Second, it looks like scan is having an issue. Seems that pred is the root cause. I think I have a fix for it, but the area I know the least in meander, so will have to check with joel before I commit anything. Hopefully can get the fix up on github today.

🙏 1
jimmy14:03:40

Didn't get a chance to meet up with Joel on this. Will make what I think is the fix today and put a PR out.

jimmy04:03:20

Pushed up the fix. Should work in the next release.