meander

All things about https://github.com/noprompt/meander Need help and no one responded? Feel free to ping @U5K8NTHEZ
jimmy 2020-12-09T15:06:07.445900Z

Sorry for taking so long to reply. I definitely don’t recommend doing this. But just wanted to reply with the eval version.

(def global-counter (java.util.concurrent.atomic.AtomicInteger. 0))
(defn next-id [] (.getAndIncrement global-counter))
(defn apply-rule [graph rule]
  (let [[pattern out] rule]
    (map vec
         (partition
          2
          (flatten
           (eval
            `(m/search
               ~graph
               (m/scan ~pattern)
               ~out)))))))
This will be rather slow as you would be compiling the expression every single time.