Java interoperability

2014-01-27 Thread Paul Smith
Hi, I am attempting to use Java interoperability. I have downloaded a dependency through Leiningen [com.jayway.jsonpath/json-path "0.9.1"] I import the dependency into a namespace (:import (com.jayway.jsonpath JsonPath) The Java class, JsonPath has a static method 'read&

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 Paul Smith
, it looks like it doesn't exist. > > Paul Smith > January 27, 2014 8:21 AM > Hi, > > I am attempting to use Java interoperability. > > I have downloaded a dependency through Leiningen > > [com.jayway.jsonpath/json-path "0.9.1"] > > I import the d

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 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 <mailto:paulaaronsmit...@gmail.com> January 27, 2014 8:21 AM Hi, I am attempting

Re: Java interoperability

2014-01-27 Thread Angel Java Lopez
hod? > > > 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 interoperability. &

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

Java interoperability and Clojure

2009-04-02 Thread Geoff Wozniak
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 convincing argument to use it where I work) and I've noticed that there doesn't

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 t

Re: Java interoperability and Clojure

2009-04-02 Thread Stuart Halloway
://github.com/stuarthalloway/programming-clojure/tree/master [2] http://github.com/stuarthalloway/programming-clojure/blob/401f348b53ddf8ba9b90a445981a134c5eb20783/lancet/test/step_2_complete.clj > > What are the limitations of Clojure and Java interoperability? Are > they clearly stated somewhere? &

Re: Java interoperability and Clojure

2009-04-03 Thread Geoff Wozniak
ds in a unit test. (See lancet/test/ > step-2-complete.clj [2], for instance). > > Hope this helps, > Stu > > [1]http://github.com/stuarthalloway/programming-clojure/tree/master > [2]http://github.com/stuarthalloway/programming-clojure/blob/401f348b53d... > > > > > > &

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

with-open and java interoperability

2009-06-06 Thread Rob Wolfe
Hi, I'm trying to understand why this program throws an exception: $ clojure -e "(clojure-version)" "1.0.0-" $ cat test1.clj (ns rw.test (:import (java.io StringReader))) (def x (with-open [s (-> (new StringReader "abc") (new clojure.lang.LineNumberingPushbackReader)

java interoperability: No such namespace error

2014-07-31 Thread Timur
Hi, (ns de.uni-stuttgart.iaas.ipsm.base-resource-service.core (:import (org.apache.logging.log4j.LogManager))) (println (LogManager/getLogger)) The above simple code throws the following exception and I could not resolve the issue: CompilerException java.lang.RuntimeException: No such names

Re: with-open and java interoperability

2009-06-06 Thread Meikel Brandmeyer
Hi, Am 06.06.2009 um 21:40 schrieb Rob Wolfe: I'm trying to understand why this program throws an exception: It doesn't work because (-> (new StringReader "abc") (new clojure.lang.LineNumberingPushbackReader)) expands to (new (new StringReader "abc") LineNumberingPushbackReader) while

Re: with-open and java interoperability

2009-06-06 Thread Rob Wolfe
Meikel Brandmeyer napisał(a): > Hi, > > Am 06.06.2009 um 21:40 schrieb Rob Wolfe: > > > I'm trying to understand why this program throws an exception: > > It doesn't work because > > > (-> (new StringReader "abc") > > (new clojure.lang.LineNumberingPushbackReader)) > > expands to > > (new (new

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: 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'

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

2009-07-23 Thread 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 ? Anyway, I've created one as an exercise, and here it is: (def

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 : 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