into-array can do that for you:

user=> (doc into-array)
-------------------------
clojure.core/into-array
([aseq] [type aseq])
  Returns an array with components set to the values in aseq. The
array's
  component type is type if provided, or the type of the first value
in
  aseq if present, or Object. All values in aseq must be compatible
with
  the component type. Class objects for the primitive types can be
obtained
  using, e.g., Integer/TYPE.
nil


user=> (into-array String [])
#<String[] [Ljava.lang.String;@51c888d9>



On Mar 28, 9:58 pm, Konrad Hinsen <konrad.hin...@fastmail.net> wrote:
> For interfacing with some Java code I need to create an empty string  
> array in Clojure. Is that possible somehow? The only way I know to  
> create a string array is
>
>         (into-array ["a" "b"])
>
> but
>
>         (into-array [])
>
> creates of course an object array.
>
> Konrad.

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