0.8.4-SNAPSHOT Arrow_down_16x16



  • (handle-clauses env [c & r :as cs])

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/dcg.clj:65 top

(defn handle-clauses [env [c & r :as cs]]
   (nil? (seq cs)) ()
   (fresh-expr? c) (cons `(fresh ~(second c)
                       ~@(handle-clauses env (drop 2 c)))
                    (handle-clauses env r))
   (!dcg? c) (cons (second c) (handle-clauses env r))
   (vector? c) (cons (->lcons env c (-> c meta :index))
                     (handle-clauses env r))
   (and (seq? c)
        (= (first c) `quote)
        (vector? (second c))) (cons (->lcons env (second c) (-> c meta :index) true)
                                     (handle-clauses env r))
   :else (let [i (-> c meta :index)
               c (if (seq? c) c (list c))]
           (cons (concat c [(env (dec i)) (env i)])
                 (handle-clauses env r)))))
Vars in clojure.core.logic.dcg/handle-clauses:
Used in 0 other vars

Comments top

No comments for handle-clauses. Log in to add a comment.