The protocol fn bar is defined in the proj.proto namespace.

You need (p/bar afoo 3) not (bar afoo 3).

David

On Fri, Nov 7, 2014 at 5:03 PM, Mike Konkov <[email protected]> wrote:
> Hi all, i'm a newbee banging his head against the wall:
>
> This works ok:
>
> (defprotocol IFoo
>   (bar [this x]))
>
> (defrecord Foo [a b c]
>   IFoo
>   (bar [_ x]
>     (+ a b c x)))
>
> (def afoo (Foo. 1 2 3))
>
> (bar afoo 3)
>
> And when I move protocol to other file it does not:
>
> (ns proj.proto)
> (defprotocol IFoo
>   (bar [this x]))
>
> (ns proj.rec
>   (:require [proj.proto :as p]))
>
> (defrecord Foo [a b c]
>   p/IFoo
>   (bar [_ x]
>     (+ a b c x)))
>
> (def afoo (Foo. 1 2 3))
>
> (bar afoo 3)
>>>"Error evaluating:" (bar afoo 3) :as 
>>>"proj.rec.bar.call(null,proj.rec.afoo,(3));\n
>
> p/IFoo evaluates to
> #js {}
> nil, so seems it's there and i'm out of ideas
>
> --
> 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 [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/clojurescript.

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/clojurescript.

Reply via email to