Skip to content

Instantly share code, notes, and snippets.

@ayato-p
Created February 7, 2017 00:00
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 ayato-p/b14ec533e7e25797b3553a040e7af99c to your computer and use it in GitHub Desktop.
Save ayato-p/b14ec533e7e25797b3553a040e7af99c to your computer and use it in GitHub Desktop.
嘘吐き!
(ns liar)
(defn with-liar* [exp]
(map (fn [sym]
(case sym
true 'false
false 'true
sym))
exp))
(require '[clojure.test :refer [is]])
(defmacro with-liar [& body]
(let [body# (map with-liar* body)]
`(do ~@body#)))
(with-liar (is true))
;; FAIL in () (form-init1497587791262311540.clj:17)
;; expected: false
;; actual: false
;; false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment