It seems definterface/deftype have a problem with "-" in the method name...
... Clojure 1.2.0-master-SNAPSHOT (today)
(definterface INm (^String get-nm []))
==> user.INm
(deftype Nm[nm] INm (^String get-nm [this] (str "Mr " nm)))
==> java.lang.IllegalArgumentException: Can't define method not in
interfaces: get_nm (NO_SOURCE_FILE:2)
(definterface INm (^String getnm []))
==> user.INm
(deftype Nm[nm] INm (^String getnm [this] (str "Mr " nm)))
==> user.Nm
(.getnm (Nm. "Smith"))
==> "Mr Smith"
Is that a bug or is there a usage rule I'm missing?
Thanks, Adrian.
On Tue, Jun 01, 2010 at 09:38:14AM -0700, Adrian Cuthbertson wrote:
> > Is that a bug or is there a usage rule I'm missing?
> seems so - underscore in the definterface method works...
I would think get-nm is not a valid Java method name.
Sincerely
Meikel
Attempting this should probably fail with an error message.
Stu
> --
> 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