Skip to content

Instantly share code, notes, and snippets.

@kindlychung kindlychung/cond.clj Secret
Created May 6, 2015

Embed
What would you like to do?
(defmacro cond2 [& body]
(when body
`(if ~(first body)
~(if (next body)
(second body)
(throw (IllegalArgumentException. "error")))
(cond2 ~(next (next (body)))))))
(cond2 (> 2 1) (println "2 > 1")
:else (println "2 <= 1"))
@kindlychung

This comment has been minimized.

Copy link
Owner Author

commented May 6, 2015

CompilerException java.lang.ClassCastException: clojure.lang.ArraySeq cannot be cast to clojure.lang.IFn, compiling:(/Users/kaiyin/personal_config_bin_files/workspace/cina/src/cina/ref_types.clj:1:24)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.