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... :-)
(def x (into-array (map into-array [[1 2] [3 4]])))
=> #'user/x

; function that destructures positional args
(defn foo [[[a b] [c d]]] [a b c d])
=> #'user/foo

; ta da
(foo x)
=> [1 2 3 4]


> 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
> ints, and those work fine too.
> 
> What I'm primarily concerned with is if there is some way to pass in a
> list/vector/etc, if there's a particular way to format the argument on
> the Java side so it can be easily converted on the Clojure side
> without much hassle (via vector or something similar), or if I need to
> just suck it up, pass in a string of numbers, and write a function on
> the Clojure side that handles all that.
> 
> To be specific, I would like to make a vector that would end up in
> pairs: [[1 2] [3 4] [5 6]]. For those of you familiar with Incanter,
> this will then become a dataset.
> 
> Thanks in advance.
> 
> -- 
> 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

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

Reply via email to