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