0.8.4-SNAPSHOT Arrow_down_16x16
  • (prep expr)
Prep a quoted expression. All symbols preceded by ? will
be replaced with logic vars.

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/core/logic/unifier.clj:55 top

(defn prep
  "Prep a quoted expression. All symbols preceded by ? will
  be replaced with logic vars."
  [expr]
  (let [lvars (atom {})
        prepped (cond
                  (lvarq-sym? expr) (proc-lvar expr lvars)

                  (lcons-expr? expr)
                  (prep* expr lvars true)

                  :else (walk-term expr (replace-lvar lvars)))]
    (if (instance? clojure.lang.IMeta prepped)
      (with-meta prepped {::lvars (keys @lvars)})
      prepped)))
Vars in clojure.core.logic.unifier/prep:
Used in 0 other vars

Comments top

No comments for prep. Log in to add a comment.