Using the fully qualified name in ClojureScript produces the following error:
Caused by: clojure.lang.ExceptionInfo: set! target must be a field or a symbol naming a var at line 7 test/graphql-tlc/core.cljs {:file "test/graphql-tlc/core.cljs", :line 7, :column 3, :tag :cljs/analysis-error}
Is this a known/expected deviation from Clojure proper?
Thanks!
--
Note that posts from new members are moderated - please be patient with your first post.
---
You received this message because you are subscribed to the Google Groups "ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojurescrip...@googlegroups.com.
To post to this group, send email to clojur...@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.
You received this message because you are subscribed to a topic in the Google Groups "ClojureScript" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojurescript/Rgnn_KPSY_o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clojurescrip...@googlegroups.com.
On Sep 15, 2015, at 10:08 PM, Jonathan Leonard <joha...@gmail.com> wrote:src/proj/one.cljs=======(ns proj.one)(defprotocol Proc(meth [this]))src/proj/two.cljs=======
(ns proj.two)
Just thinking about it: one diff between this project and the minimal repro provided before is that the protocol is defined in 'src' and implemented in 'test' (but that really shouldn't matter if I understand what's going on with cljsbuild).
--Jonathan
Per the documentation on defprotocol for Clojure itself, such a reference (e.g., in a reify of a protocol defined in a separate file/namespace) does require a fully qualified name (and will not accept unqualified name).
Using the fully qualified name in ClojureScript produces the following error:
Caused by: clojure.lang.ExceptionInfo: set! target must be a field or a symbol naming a var at line 7 test/graphql-tlc/core.cljs {:file "test/graphql-tlc/core.cljs", :line 7, :column 3, :tag :cljs/analysis-error}
Is this a known/expected deviation from Clojure proper?
Thanks!
On Wed, Sep 16, 2015 at 12:28 AM, Jonathan Leonard <joha...@gmail.com> wrote:Per the documentation on defprotocol for Clojure itself, such a reference (e.g., in a reify of a protocol defined in a separate file/namespace) does require a fully qualified name (and will not accept unqualified name).As far as I know this is not the case. If the documentation says so it is incorrect with respect to the implementation and code in the wild, https://github.com/clojure/core.async/blob/master/src/main/clojure/clojure/core/async/impl/channels.clj#L67
Please note: "All [both the methods and the protocol itself] are
namespace-qualified by the ns enclosing the definition" from:https://clojuredocs.org/clojure.core/defprotocol
Also, I've gotten compile errors from Clojure itself when the qualification is left out and I've read tutorials which also say that the namespace is required.Using the fully qualified name in ClojureScript produces the following error:
Caused by: clojure.lang.ExceptionInfo: set! target must be a field or a symbol naming a var at line 7 test/graphql-tlc/core.cljs {:file "test/graphql-tlc/core.cljs", :line 7, :column 3, :tag :cljs/analysis-error}
Is this a known/expected deviation from Clojure proper?
Thanks!The bug is that qualified protocol methods are not supported in ClojureScript. Please open a minor issue about this in JIRA with your minimal example.
Thanks!David
You received this message because you are subscribed to the Google Groups "ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojurescrip...@googlegroups.com.
You received this message because you are subscribed to a topic in the Google Groups "ClojureScript" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojurescript/Rgnn_KPSY_o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clojurescrip...@googlegroups.com.
I do think that under the skin what's happening here is that the vars associated with the methods inside the declared protocol are being defined on the global namespace (which is fine in JavaScript since everything ends up in the same file most likely anyway). I doubt that this bug would even be possible in Clojure proper since it compiles things into Java namespaces and classes.--Jonathan
Sorry for the confusion!