Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
;=> auth-context
#<Delay@2cca1df3: #<JiraAuthenticationContextImpl>>
;=> (defmacro as-user [user & body]
`(let [old-user# (.getUser @auth-context ~user)]
(.setUser @auth-context ~user)
(finally (.setUser @auth-context old-user#)))))
;=> (macroexpand '(as-user FOO (bar baz)))
(let* [old-user__942__auto__ (.getUser (clojure.core/deref clojure.core/auth-context) FOO)] (.setUser (clojure.core/deref clojure.core/auth-context) FOO) (try (bar baz) (finally (.setUser (clojure.core/deref clojure.core/auth-context) old│
;;; ...the clojure.core/auth-context references are the immediate issue here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.