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?
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.
Thanks!
Pushed up the fix. Should work in the next release.
Thanks!
Thanks!
After doing a bit of source spelunking... Is scan
not supported in interpreter?
you should use the functions available in ns meander.epsilon.interpreter
not meander.epsilon
here is the declaration https://github.com/noprompt/meander/blob/epsilon/src/meander/interpreter/epsilon.cljc#L10
i would also recommend looking at the test file
https://github.com/noprompt/meander/blob/epsilon/test/meander/interpreter/epsilon_test.cljc
meander develops faster than the documentation is completed
but the tests are always up to date and cover 100% of what the meander can do
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.