Skip to content

Commit

Permalink
* src/main/cljs/cljs/core/logic.cljs: implement IEquiv for Pair. prin…
Browse files Browse the repository at this point in the history
…ting for Pair. toString for LVar.
  • Loading branch information
David Nolen authored and David Nolen committed Mar 24, 2012
1 parent 8765743 commit 268adae
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/main/cljs/cljs/core/logic.cljs
Expand Up @@ -60,6 +60,10 @@
(-rhs [this]))

(deftype Pair [lhs rhs]
IEquiv
(-equiv [this other]
(and (= lhs (.-lhs other))
(= rhs (.-rhs other))))
ICounted
(-count [_] 2)
IIndexed
Expand Down Expand Up @@ -123,6 +127,10 @@
(and (instance? Substitutions o)
(= s (.-s o)))))

IPrintable
(-pr-seq [this opts]
(-pr-seq s opts))

ISubstitutions
(-length [this] (count l))

Expand Down Expand Up @@ -194,6 +202,9 @@
;; Logic Variables

(deftype LVar [name meta]
Object
(toString [this]
(pr-str this))
IMeta
(-meta [this]
meta)
Expand Down

0 comments on commit 268adae

Please sign in to comment.