Fork me on GitHub
#core-typed
<
2015-12-27
>
donaldball02:12:54

(defmacro case-split
  "Usage: (case-split v
            type1 expr1
            type2 expr2
            ...)"
  [x & cases]
  (cons 'cond
        (mapcat (fn [[type expr]]
                  (list (list (list 'clojure.core.typed/pred type) x) expr))
                (partition-all 2 cases))))

donaldball02:12:07

Is this an abuse of pred?