meander

Ben Sless 2021-10-23T07:17:34.001Z

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))))
?

markaddleman 2021-10-23T10:59:58.001800Z

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 Sless 2021-10-23T11:52:08.002Z

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

👍 1
2021-10-23T07:34:45.001500Z

why not macro?

Ben Sless 2021-10-23T07:35:42.001700Z

want to pass it as data

Jimmy Miller 2021-10-23T15:32:30.004700Z

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.