Skip to content

Instantly share code, notes, and snippets.

@borkdude
Created April 13, 2012 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save borkdude/2377228 to your computer and use it in GitHub Desktop.
Save borkdude/2377228 to your computer and use it in GitHub Desktop.
(defmacro do-if-short [& body]
(if (> (count body) 3)
"No way, your program is too long"
`(do ~@body)))
(do-if-short (println "foo") (println "bar"))
;;=>
foo
bar
nil
(do-if-short (println "foo") (println "bar") (println "baz") (println "fff"))
;;=> "No way, your program is too long"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment