You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
last week i ran into a weird issue when trying to deploy the jar using mixfix via lein uberjar. This StackOverflow issue summarises the essence of it.
Basically, it seems that op macro modifies a global *lang* and therefore fails when run from an uberjar, as in that case contents of the global remain unchanged. As per Leonid Beschastny's comment, do you think it is possible to modify the definition of the op macro by prepending syntax-quote to its body? It would then transform to:
(defmacro op
"Defines mixfix operator. First optional argument is a name for the
operator's scope. The second is precedence level of the operator. The bigger
the number the tightly the operator binds. The third is resulting form head
symbol. And the last one is a mixfix picture of the operator."
([lang prec symbol picture]
`(binding [*lang* @(resolve &env lang)] (add-op prec symbol picture) nil))
([prec symbol picture] `(add-op prec symbol picture) nil))
My knowledge of macros is quite limited, so I apologise if this modification seems like nonsense to you.
Thanks,
Vitaliy.
The text was updated successfully, but these errors were encountered:
Absence of syntax quote is critical there, as it is compile time variable. It will work with it on Clojure but won't on ClojureScript unfortunately, since there they are 2 separate stages. I haven't tried building uberjars with the library, I will try to find some solution, thanks for report.
Hi Vitaliy,
last week i ran into a weird issue when trying to deploy the jar using mixfix via
lein uberjar
. This StackOverflow issue summarises the essence of it.Basically, it seems that
op
macro modifies a global*lang*
and therefore fails when run from an uberjar, as in that case contents of the global remain unchanged. As per Leonid Beschastny's comment, do you think it is possible to modify the definition of theop
macro by prepending syntax-quote to its body? It would then transform to:My knowledge of macros is quite limited, so I apologise if this modification seems like nonsense to you.
Thanks,
Vitaliy.
The text was updated successfully, but these errors were encountered: