Can't define method not in interfaces...what is this?

1,403 views
Skip to first unread message

Jim - FooBar();

unread,
Nov 18, 2012, 4:16:58 PM11/18/12
to clo...@googlegroups.com
I'm struggling to find an explanation for this...

what on earth is this? what does it mean?

Can anyone clarify where this exception comes from?

Jim

Karsten Schmidt

unread,
Nov 18, 2012, 5:11:15 PM11/18/12
to clo...@googlegroups.com
It might mean you're probably having a typo somewhere you're trying to
extend a protocol like so:

(defprotocol IFoo
(foo [x]))

(defrecord MyFoo [x y]
IFoo
(fooo [x] x)) ; note misspelled foo

;; CompilerException java.lang.IllegalArgumentException:
;; Can't define method not in interfaces: fooo, compiling:(NO_SOURCE_PATH:1)

Correct? K.
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clo...@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+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

Jim - FooBar();

unread,
Nov 18, 2012, 5:27:00 PM11/18/12
to clo...@googlegroups.com
Ok that was frustrating! I had a docstring like below which apparently
is not allowed.

(defrecord MyFoo [x y]
IFoo
(foo "returns arg" [x] x)) ;


phew... :)

thanks!

Jim
Reply all
Reply to author
Forward
0 new messages