Skip to content

Instantly share code, notes, and snippets.

@mfikes
Last active Feb 2, 2021
Embed
What would you like to do?
Macro with side effect in ClojureScript
% clj -M -m cljs.main
ClojureScript 1.10.773
cljs.user=> (require 'foo.core)
nil
cljs.user=> (foo.core/m 1)
here
2
(ns foo.core)
(defmacro m [a]
(println "here")
`(do-a-thing ~a))
(ns foo.core
(:require-macros [foo.core]))
(defn do-a-thing [x]
(inc x))
{:deps {org.clojure/clojurescript {:mvn/version "1.10.773"}}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment