Permalink
Browse files

* src/main/clojure/cljs/core/logic/macros.clj: fix condu

  • Loading branch information...
1 parent a1573e5 commit 8cc3384a28d87a8c80bb04fd48ffed8d5218044c David Nolen committed Apr 3, 2012
Showing with 18 additions and 19 deletions.
  1. +1 −1 src/main/clojure/cljs/core/logic/macros.clj
  2. +17 −18 src/test/cljs/cljs/core/logic/tests.cljs
@@ -190,7 +190,7 @@
(defmacro ifu*
([])
([[e & gs] & grest]
- `(cljs.core-logic/-ifu ~e [~@gs]
+ `(cljs.core.logic/-ifu ~e [~@gs]
~(if (seq grest)
`(delay (ifu* ~@grest))
nil))))
@@ -718,27 +718,26 @@
;; -----------------------------------------------------------------------------
;; condu (committed-choice)
-(comment
- (defn onceo [g]
- (condu
- (g s#)))
+(defn onceo [g]
+ (condu
+ (g s#)))
- (assert (= (run* [x]
- (onceo (teacupo x)))
- '(tea)))
+(assert (= (run* [x]
+ (onceo (teacupo x)))
+ '(tea)))
- (assert (= (run* [r]
- (conde
- [(teacupo r) s#]
- [(m/== false r) s#]))
- '(false tea cup)))
+(assert (= (run* [r]
+ (conde
+ [(teacupo r) s#]
+ [(m/== false r) s#]))
+ '(false tea cup)))
+
+(assert (= (run* [r]
+ (conda
+ [(teacupo r) s#]
+ [(m/== false r) s#]))
+ '(tea cup)))
- (assert (= (run* [r]
- (conda
- [(teacupo r) s#]
- [(m/== false r) s#]))
- '(tea cup)))
- )
;; -----------------------------------------------------------------------------
;; nil in collection

0 comments on commit 8cc3384

Please sign in to comment.