Skip to content

Instantly share code, notes, and snippets.

@talios
Created March 1, 2010 08:30
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 talios/318201 to your computer and use it in GitHub Desktop.
Save talios/318201 to your computer and use it in GitHub Desktop.
(deftest symbol-test
(defsymbolmacro sum-2-3 (plus 2 3))
(is (= (macroexpand '(with-symbol-macros (+ 1 sum-2-3)))
'(do (+ 1 (plus 2 3)))))
(is (= (macroexpand '(macrolet [(plus [a b] `(+ ~a ~b))] (+ 1 sum-2-3)))
'(do (+ 1 (clojure.core/+ 2 3)))))
(ns-unmap *ns* 'sum-2-3))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment