just hit this bug reported sep 2019 https://ask.clojure.org/index.php/8497/protocol-implementations-metadata-clojurescript-differently?show=8497 any way to track it in public jira or request core team to review it?
@gdanov You can upvote the issue to signal more priority
Also you could ask in #cljs-dev if there is already a JIRA issue for this and if there is interest in addressing it
thanks. my vote is #2 so Iāll take it to the chanel
Oh no, I got swallowed by a āNo reader function for tag object.ā
So, the local-storage cache had a corruption, removed it and everything is fine
But that error message really got me hanging not knowing what to do
Sorryā¦ I donāt see context for this. Do you know the tag that youāre failing on?
A JS object's default string representation is #object[Object]
that would be interpreted by the reader as a tagged literal with tag #object
at least thats my guess for what happened
Yes, thatās exactly how the reader sees it
Is this imported data, or did you generate it?
If you can regenerate the code, then thatās what you want to do.
If you canāt, then you can break bend the rules:
=> (def a (edn/read-string {:readers {'object identity}} "#object[Object]"))
=> (type a)
cljs.core/PersistentVector
=> (type (first a))
cljs.core/Symbol
You can have a non-namespaced reader tag (in this case 'object
) and it will give you a 1 element vector with the symbol Object
inside of it. You can choose to do what you want. Itāll get you through the reading phase anyway.
To the best of my knowledge, this is not documented, and it could break in futureā¦ but itās a possibility if you have no other choices
The reason I think itās against the rules is because the Clojure reader docs and the edn docs say that tags have to be namespaced. However, this is not enforced.
what is the best way to get the calling namespace in a macro
as a strawman, i'd like to write a macro that does
(my-macro abc) -> ::calling.ns/abc
(defmacro my-macro [x]
(keyword (str *ns*) (name x)))
won't that get the ns of the macro
no, *ns*
is bound to the "current/calling" ns when expanding macros.
there is also (-> &env :ns :name)
but thats CLJS only, *ns*
also works in CLJ