view 6-Clojure/macro.clj @ 103:98be775c533c default tip

An odd "non-determinism" example from StackOverflow It is clever, but doesn't make much sense as to how it gets its results
author IBBoard <dev@ibboard.co.uk>
date Sun, 14 Jul 2019 13:44:13 +0100
parents eccc649d49a2
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"))