Hello,

On Tue, Mar 09, 2010 at 01:15:28PM -0800, TimDaly wrote:
> I searched the archives and google but cannot find an example.
> How do I call main?
> 
> packge thefoo;
> 
> public class Foo {
>   public static void main(String[] args) {
>     System.out.println(args[0]);
>   }
> }
> 
> I tried
> (import '(thefoo Foo))
> 
> (. Foo (thefoo/main ["test"]))
> java.lang.ClassCastException: clojure.lang.PersistentVector cannot be
> cast to [Ljava.lang.String
> 
> I thought that PersistentVector and arrays were identical.
> 
> Surely I can't be the first to try this but I cannot find an example.
> 
> Tim

I think you need to use into-arry to co-erce the collection into a
String array.  Since main is a static method, your invocation can be
shortened to:

(Foo/main (into-array ["test"]))


Sincerely,

Daniel Solano Gómez

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