Fork me on GitHub
#meander
<
2020-12-17
>
noprompt00:12:28

@mac You should be able to try out quoted patterns now.

noprompt00:12:27

(require '[meander.epsilon.interpreter :as mi])

((mi/finder '[?x ?y] identity) [1 2]))
;; => {?x 1, ?y 2}

noprompt00:12:23

Please report any issues you encounter.

borkdude08:12:54

@noprompt

$ cat /tmp/meander.clj
(ns private.tmp.meander)

(require '[babashka.deps :as deps])
(deps/add-deps '{:deps {meander/epsilon {:mvn/version "0.0.588"}}})
(require '[meander.epsilon.interpreter :as mi])
((mi/finder '[?x ?y] identity) [1 2])
$ bb /tmp/meander.clj
Downloading: meander/epsilon/0.0.588/epsilon-0.0.588.pom from clojars
Downloading: meander/epsilon/0.0.588/epsilon-0.0.588.jar from clojars
----- Error --------------------------------------------------------------------
Type:     java.lang.Exception
Message:  Could not find namespace: meander.epsilon.interpreter.
Location: /tmp/meander.clj:5:1

borkdude08:12:37

Ah, the namespace segments should be reversed: meander.interpreter.epsilon

borkdude09:12:43

@noprompt on clojure and bb I'm getting:

{:meander.interpreter.epsilon/cata #object[meander.interpreter.epsilon$match_system_factory$fn__3238$f__3241 0x4863c8ac "meander.interpreter.epsilon$match_system_factory$fn__3238$f__3241@4863c8ac"], ?x 1, ?y 2}

noprompt18:12:59

@borkdude Yes. I elided that key in the other examples for demonstration purposes and probably should have added a ,,, or something to denote the presence of “other stuff”.

noprompt18:12:08

The cata function is put in the map so that the cata pattern can work properly.

noprompt18:12:08

I could have put it in meta data or something but the cost of calling with-meta in pretty much every in location where bindings are being manipulated is expensive.

noprompt18:12:11

Another thing we can do is dissoc it, but that’s also extra work that doesn’t technically need to go down.

Jimmy Miller21:12:00

I'd say dissocing makes sense. It is just going to confuse people and probably not provide any value.

noprompt00:12:27

OK. I’m good with that.

noprompt18:12:37

For find style stuff, probably not a big deal, and it may not even be a big deal for search either.

borkdude18:12:10

this is fine

noprompt18:12:19

I’m a big push over though. If it’s annoying people, I have no problem with blasting it from space.