aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/clojure/clojure/contrib/monads.clj6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/clojure/clojure/contrib/monads.clj b/src/main/clojure/clojure/contrib/monads.clj
index 3cb1bd16..d164f7eb 100644
--- a/src/main/clojure/clojure/contrib/monads.clj
+++ b/src/main/clojure/clojure/contrib/monads.clj
@@ -72,8 +72,10 @@
monad comprehension expression mexpr."
[mexpr step]
(let [[bform expr] step]
- (cond (identical? bform :when) `(if ~expr ~mexpr ~'m-zero)
- (identical? bform :let) `(let ~expr ~mexpr)
+ (cond (identical? bform :when) `(if ~expr ~mexpr ~'m-zero)
+ (identical? bform :when-not) `(if ~expr ~'m-zero ~mexpr)
+ (identical? bform :let) `(let ~expr ~mexpr)
+ (identical? bform :when-let) `(if-let ~expr ~mexpr ~'m-zero)
:else (list 'm-bind expr (list 'fn [bform] mexpr)))))
(defn- monad-expr