Hi!

The following simplified code works:
----
(defn save-article
  [path form-params timestamp]
  (ds/save! (Article. path (form-params "title") (form-params "body")
     timestamp))))
----

But I would like to not handle the content of form-params explicitly.

My naive attempt that shows that I still have troubles with the evaluation model:
----
(ds/save! (flatten `(Article. path ~(vals form-params) timestamp)))
----
Fails with: "java.lang.IllegalArgumentException: No implementation of method: :get-entity-object of protocol: #'appengine-magic.services.datastore/EntityProtocol found for class: clojure.lang.Symbol"

I take that I created a list that looks like the function call that I need, but that is not evaluated as such. Throwing in eval doesn't help.
Can you shed some light on this?

How can I accomplish not having to make the content of form-params explicitly? (Not to save on typing, more for my understanding.)


--
Thorsten Wilms

thorwil's design for free software:
http://thorwil.wordpress.com/

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