your map is being spliced in to the output, but your output contains lists (...) which are interpreted as functions, and the first thing in the list is a map, makes take 1-2 args, your list forms with maps as the operator have more that 2 args. please use macroexpand.
On Mon, Apr 25, 2011 at 7:29 PM, Timothy Washington <[email protected]> wrote: > Hey all, > > I'm not quite understanding why an eval call is not working in this > instance. A) works, but B) fails with an > java.lang.IllegalArgumentException. > > A) Pretty straightforward ... > > user=> `(+ 1 ~@[2 3]) > > (clojure.core/+ 1 2 3) > > … > > user=> (eval `(+ 1 ~@[2 3])) > > 6 > > B) I just want to call my 'commands/add' function with a map and 'teal' > (nil, in this case) > > user=> `(commands/add ~processed ~@etal) > > (commands/add {:tag :user, :username "stub", :content ({:tag > :profileDetails, :content ({:tag :profileDetail, :name > > "first.name", :value "stub", :content nil} {:tag :profileDetail, :name > "last.name", :value "stub", :content nil} {:tag :profileDetail > > , :name "email", :value "stub", :content nil} {:tag :profileDetail, :name > "country", :value "stub", :content nil})})}) > > user=> (eval `(commands/add ~processed)) > > java.lang.IllegalArgumentException: Wrong number of args (3) passed to: > PersistentArrayMap (NO_SOURCE_FILE:89) > > C) A stack trace isn't that helpful either > > user=> (. *e printStackTrace) > > java.lang.IllegalArgumentException: Wrong number of args (3) passed to: > PersistentArrayMap (NO_SOURCE_FILE:183) > > at clojure.lang.Compiler.eval(Compiler.java:5440) > > at clojure.lang.Compiler.eval(Compiler.java:5391) > > at clojure.core$eval.invoke(core.clj:2382) > > at bkell$add.doInvoke(bkell.clj:23) > > … > > What am I missing here? > > Thanks in advance > > Tim > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to [email protected] > Note that posts from new members are moderated - please be patient with your > first post. > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en -- And what is good, Phaedrus, And what is not good— Need we ask anyone to tell us these things? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/clojure?hl=en
