view 6-Clojure/macro.clj @ 83:eccc649d49a2

Add Day 2 and Day 3 notes and example code Clojure STILL doesn't make much sense in lots of places
author IBBoard <dev@ibboard.co.uk>
date Sat, 08 Jun 2019 21:23:27 +0100
parents
children
line wrap: on
line source

(defmacro unless [test body]
    (list 'if (list 'not test) body))

(macroexpand '(unless condition body))

(unless true (println "Should not print"))
(unless false (println "Should print"))