On Wed, Jan 18, 2012 at 4:58 PM, Dave Sann <daves...@gmail.com> wrote:

> Scenario:
>
> Define a protocol, generally:
>
> in some-ns.fred
>
> (defprotocol Fred
>   (fred [this] "do something cool and useful"))
>
> Specifically extend the protocol for dom objects
>
> in someother-ns.dom.fred
>
> ; implementing Fred for the dom
>
> (extend-protocol Fred
>   js/Node
>   (fred [node] (...cool with the dom...)))
>
>
> What is the correct way to ensure that the dom-extended protocol is
> available to compiled (cljs code)?
> All my client code uses the general protocol.
> Currently I have resorted to explicitly requiring the dom variant in the
> file that is effectively "main"
>
> Is this "correct"
> If I don't do this - I can get "protocol not implemented" type exceptions.
>
> Cheers
>
> Dave
>

Did you look at the generated JS? Is that code missing?

David

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to