Closed lucywang000 closed 3 years ago
@lucywang000 The symbol resolution for syntax extensions relies on meander.util.epsilon/expand-symbol
. I think the Clojure resolution could probably be changed to use clojure.core/resolve
and then get the symbol from the var if it exists, otherwise leave the symbol untouched. I'm a little busy at the moment and won't be able to look at this until later today. If you're able to find a patch, don't hesitate to open a pull request.
the Clojure resolution could probably be changed to use clojure.core/resolve and then get the symbol from the var if it exists, otherwise leave the symbol untouched.
That sounds brilliant! what about the cljs side? Is there a way to check whether a symbol has an alias in the current ns?
@lucywang000 I've patched this and will now make a release. See #146 for the code details.
I was debugging some code that involves custom defsyntax, just to find that the culprit is, if I have a custom syntax
foo-syntax
defined in nsfoo
, and want to use it inbar
, I have to always usefoo/foo-syntax
(orfoo-alias/foo-syntax
if I'm aliasing thefoo
ns name), even if I have:require [foo :refer [foo-syntax]]
in bar's ns declaration.Is this expected behavior? If so we shall document it explicitly.
foo.clj
bar.clj