Fork me on GitHub
#meander
<
2021-10-23
>
Ben Sless07:10:34

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

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

markaddleman10:10:58

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
ribelo07:10:45

why not macro?

Ben Sless07:10:42

want to pass it as data

jimmy15:10:30

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.