Re: Passing Arguments From Java to Clojure

2010-06-16 Thread rzeze...@gmail.com
-- CallClojure.java -- import clojure.lang.RT; import clojure.lang.Var; import clojure.lang.PersistentVector; public class CallClojure { static PersistentVector toVec(int[][] arr) { PersistentVector pv = PersistentVector.EMPTY; for (int[] a : arr) { Persist

Re: Passing Arguments From Java to Clojure

2010-06-16 Thread Stuart Halloway
Do you really need a Clojure vector-of-vectors, or do you just want an indexed collection of indexed collections? If the latter, you can simply use Java arrays, or ArrayMaps. ; build a collection a Java programmer might have made ; (I am not really going to go into Java just for an example... :

Re: Passing Arguments From Java to Clojure

2010-06-16 Thread Daniel
Actually, just look at the main method (for testing) which has been commented out at the bottom - that will show you a better way to create and use it. On Jun 16, 9:37 am, allie wrote: > There's a canonical intro on how to call or embed Clojure into > Java:http://en.wikibooks.org/wiki/Clojure_Pr

Re: Passing Arguments From Java to Clojure

2010-06-16 Thread Daniel
You need to pass in a PersistentVector of PersistentVector's. It's in clojure.lang and there are a number of static creation methods. On Jun 16, 9:37 am, allie wrote: > There's a canonical intro on how to call or embed Clojure into > Java:http://en.wikibooks.org/wiki/Clojure_Programming/Tutoria

Passing Arguments From Java to Clojure

2010-06-16 Thread allie
There's a canonical intro on how to call or embed Clojure into Java: http://en.wikibooks.org/wiki/Clojure_Programming/Tutorials_and_Tips#Invoking_Clojure_from_Java While this is a great introduction, the only thing Java passes in to Clojure here is a string. I've tried methods where Java passes in