Fork me on GitHub
Ben Sless07:10:34

Is there a convenient way to compile patterns without resorting to something like

(defn compile-match
  (eval `(fn [~'x] (e/match ~'x ~pat true))))


Can you use a strategy to dynamically compose the patterns? It not, check out meander interpreter. Not compiled and much slowe, but the interpreter does take data.

Ben Sless11:10:08

I don't really mind using eval, but I wouldn't do that with data coming over the wire

👍 1

why not macro?

Ben Sless07:10:42

want to pass it as data


Meander is definitely not optimized around patterns coming over the network. If you allow that, you are ultimately allowing arbitrary code. What we typically recommend is to use meander to write an interpreter/compiler for your own little pattern language.