On Tue, Aug 2, 2011 at 9:37 AM, finbeu <info_pe...@t-online.de> wrote: > Hello, > > how do I have to use an enum in clojure that is enclosed in an java > interface? I decomplied it in IDEA and I got something like that: > > package com.api.test; > > public interface Foo { > ..... > ..... > static final enum BarType { > public static final ONE, public static final TWO, public static > final THREE, public static final FOUR; > > .... > .... > } > } > > How do I have to import and use that in clojure? > > I need to call a java method with such an enum but I can't get it to work > although I have already done lots of guesswork. > > (:import (com.api.test Foo Foo.BarType)) ?????? > (let [ test (.theMethod myObject BlaBlaType.ONE) ]) ????
Try (.theMethod myObject com.api.test.Foo$BarType/ONE) and let me know how that works. -- Protege: What is this seething mass of parentheses?! Master: Your father's Lisp REPL. This is the language of a true hacker. Not as clumsy or random as C++; a language for a more civilized age. -- 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