Skip to content

Commit

Permalink
* src/main/clojure/clojure/core/logic.clj: all silly type hints elimi…
Browse files Browse the repository at this point in the history
…nated
  • Loading branch information
David Nolen authored and David Nolen committed Aug 1, 2012
1 parent 85abe67 commit 5bec691
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/main/clojure/clojure/core/logic.clj
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -3157,6 +3157,13 @@
(every? domain? (map #(walk s %) (rands c))))) (every? domain? (map #(walk s %) (rands c)))))


(deftype FDConstraint [proc _id _meta] (deftype FDConstraint [proc _id _meta]
clojure.lang.ILookup
(valAt [this k]
(.valAt this k nil))
(valAt [this k not-found]
(case k
:proc proc
not-found))
Object Object
(equals [this o] (equals [this o]
(if (instance? FDConstraint o) (if (instance? FDConstraint o)
Expand Down Expand Up @@ -3202,11 +3209,10 @@
(FDConstraint. proc nil nil)) (FDConstraint. proc nil nil))


(defmethod print-method FDConstraint [x ^Writer writer] (defmethod print-method FDConstraint [x ^Writer writer]
(let [^FDConstraint x x (let [cid (if-let [cid (id x)]
cid (if-let [cid (id x)]
(str cid ":") (str cid ":")
"")] "")]
(.write writer (str "(" cid (rator (.proc x)) " " (apply str (interpose " " (rands (.proc x)))) ")")))) (.write writer (str "(" cid (rator (:proc x)) " " (apply str (interpose " " (rands (:proc x)))) ")"))))


(defmacro infd (defmacro infd
"Assign vars to domain. The domain must come last." "Assign vars to domain. The domain must come last."
Expand Down

0 comments on commit 5bec691

Please sign in to comment.