Re: java interoperability: No such namespace error

2014-07-31 Thread Timur
Yes that was it thank you! On Thursday, July 31, 2014 10:07:14 PM UTC+2, Sam Ritchie wrote: > > I think you need a space before the final LogManager, not just a period: > > (ns de.uni-stuttgart.iaas.ipsm.base-resource-service.core > (:import [org.apache.logging.log4j LogManager]) > > The vector'

Re: java interoperability: No such namespace error

2014-07-31 Thread Sam Ritchie
I think you need a space before the final LogManager, not just a period: (ns de.uni-stuttgart.iaas.ipsm.base-resource-service.core (:import [org.apache.logging.log4j LogManager]) The vector's just for style, a list works just as well. Timur July 31, 2014 at 1:4

Re: Java interoperability

2014-01-27 Thread Jarrod Swart
The typical route I take is to always check http://clojure-toolbox.com first to see if a library exists. If not and it's a trivial thing I might just write it myself. My first thought is never, "Hey I should go grab a Java lib to do this." But typically yes JSON is extremely close to clojure

Re: Java interoperability

2014-01-27 Thread Paul Smith
Hi Jarrod > Any reason not to use a Clojure library like cheshire for JSON? Yes, I am probably taking the wrong approach. Is the Clojure way to put the JSON in Clojure data structures and manipulate it with filters etc? Many Thanks Paul On Mon, Jan 27, 2014 at 3:35 PM, Jarrod Swart wrote: >

Re: Java interoperability

2014-01-27 Thread Paul Smith
Hi Sam, Thanks for your response. I am been following the API documentation: https://code.google.com/p/json-path/ and the tests https://github.com/jayway/JsonPath/blob/master/json-path/src/test/java/com/jayway/jsonpath/JsonPathTest.java But looking at the source their only seems to be a static r

Re: Java interoperability

2014-01-27 Thread Jarrod Swart
It looks like the method exists to me: https://github.com/jayway/JsonPath/blob/master/json-path/src/main/java/com/jayway/jsonpath/JsonPath.java#L-445-505 It looks like the problem is that you are passing in empty strings: https://github.com/jayway/JsonPath/blob/master/json-path/src/main/java/com

Re: Java interoperability

2014-01-27 Thread Angel Java Lopez
Ummm... the methods has a generic T parameter, ie https://github.com/jayway/JsonPath/blob/master/json-path/src/main/java/com/jayway/jsonpath/JsonPath.java#L446 Any way to invoke them, from Clojure? On Mon, Jan 27, 2014 at 12:27 PM, Sam Ritchie wrote: > Where do you see that method? > > > https

Re: Java interoperability

2014-01-27 Thread Sam Ritchie
Where do you see that method? https://github.com/jayway/JsonPath/blob/master/json-path/src/main/java/com/jayway/jsonpath/JsonPath.java Perusing the code, it looks like it doesn't exist. Paul Smith January 27, 2014 8:21 AM Hi, I am attempting to use Java int

Re: java interoperability : calling set! on several fields of the same instance

2009-07-23 Thread Laurent PETIT
Yes it works ! : 1:172 user=> (doto (java.awt.Point.) (-> .x (set! 2))) # I hadn't thought about this possible combination, thanks Meikel. So now, is mset! worth the trouble ? Let's compare them again: (doto (SomeBeanCtor.) (-> .field1 (set! expr1)) (-> .field2 (set! expr2)) (-> .field4 (s

Re: java interoperability : calling set! on several fields of the same instance

2009-07-23 Thread Meikel Brandmeyer
Hi, Am 23.07.2009 um 18:24 schrieb Laurent PETIT: Hello, I want to call set! several times on a same instance, e.g. : (let [instance (SomeBeanCtor.)] (set! (. instance field1) expr1) (set! (. instance field2) expr2) ...) Do you know if a macro simplifying this already exists ? How abo

Re: Java interoperability and Clojure

2009-04-04 Thread kyle smith
I wrote some functions to streamline reflection here. http://groups.google.com/group/clojure/browse_thread/thread/ea23cd11b7bd8999/f32795d9a79eeeb9?lnk=gst&q=accessing+private#f32795d9a79eeeb9 --~--~-~--~~~---~--~~ You received this message because you are subscribe

Re: Java interoperability and Clojure

2009-04-03 Thread Geoff Wozniak
Thanks for the links, Stuart, although I managed to figure out what I was doing wrong: I didn't realize that the Java vararg type Object... mapped to a sequence in Clojure, so I wasn't properly calling 'invoke' in java.lang.reflect.Method. Again, thanks for the links. I'm sure they'll be helpful

Re: Java interoperability and Clojure

2009-04-02 Thread Stuart Halloway
Hi Geoff, You should have no trouble using setAccessible. There are several demos of this in the source code for the book [1] that use setAccessible to check private fields in a unit test. (See lancet/test/ step-2-complete.clj [2], for instance). Hope this helps, Stu [1] http://github.com

Re: Java interoperability and Clojure

2009-04-02 Thread Rayne
As far as I know, there is no limit. On Apr 2, 11:22 am, Geoff Wozniak wrote: > What are the limitations of Clojure and Java interoperability? Are > they clearly stated somewhere? > > I have been experimenting with using Clojure to test some existing > Java code (being able to do so makes a conv