aboutsummaryrefslogtreecommitdiff
path: root/src/clojure/contrib/macros.clj
diff options
context:
space:
mode:
Diffstat (limited to 'src/clojure/contrib/macros.clj')
-rw-r--r--src/clojure/contrib/macros.clj9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/clojure/contrib/macros.clj b/src/clojure/contrib/macros.clj
index e58892c4..5820e48e 100644
--- a/src/clojure/contrib/macros.clj
+++ b/src/clojure/contrib/macros.clj
@@ -26,3 +26,12 @@
(let [makefn (fn [[name args body]] (list name (list 'fn name args body)))
fns (vec (apply concat (map makefn (partition 3 fn-bindings))))]
`(let ~fns ~@exprs)))
+
+;; By Konrad Hinsen
+(defmacro lazy-and-standard-branch
+ "Comile the first expression in the lazy branch of Clojure, and the second
+ one in the standard branch."
+ [lazy-expr standard-expr]
+ (if (find (ns-map (find-ns 'clojure.core)) 'lazy-seq)
+ lazy-expr
+ standard-expr))