Hi Meikel
Thank you for your reply.  Is there a way to populate the HashMap
before passing it to the invoke method

I tried the following
Var keyword = RT.var("clojure.core", "keyword");
Var hashMap = RT.var("clojure.core", "hash-map");
hashMap.invoke(keyword.invoke("a"), 1);

then I created the following function
(defn foo[key paramMap](key paramMap))

Object result=foo.invoke(keyword.invoke("a"), hashMap);

But I got null returned but when I do as you suggest
Object result=foo.invoke(keyword.invoke("a"),
hashMap.invoke(keyword.invoke("a"), 1));
I get 1 returned

Any suggestions welcomed

On Sep 16, 9:56 am, "Meikel Brandmeyer (kotarak)" <m...@kotka.de>
wrote:
> Hi,
>
> Am Donnerstag, 15. September 2011 23:39:10 UTC+2 schrieb Eamonn:
>
> > The code  works BUT if I try to pass in a map for example like so
> > Object result = foo.invoke( "hello","world","#{:a 1 :b 2}");
>
> This does not pass a map to the function, but the string "#{:a 1 :b 2}". And
> from your example I don't see where the class cast exception should come
> from. To create a clojure map use the normal hash-map function.
>
> Var keyword = RT.var("clojure.core", "keyword");
> Var hashMap = RT.var("clojure.core", "hash-map");
>
> foo.invoke("hello", "world", hashMap.invoke(keyword.invoke("a"), 1,
> keyword.invoke("b"), 2));
>
> Hope this helps.
>
> Sincerely
> Meikel

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