On 05/09/2011 10:15 PM, Thorsten Wilms wrote:

I tried to turn that into a transformation:

(defn substitute-token
[& values]
#(map (fn [m] (update-in m [:content]
(fn [c] (apply (partial replace-str
"token" %) c))))
values))

Apparently I had my brain knotted, but raek and fliebel on IRC helped with untying some misconceptions :)

So the solution for applying a function, (partial replace-str "token" to) in this case, on the content in html nodes as Enlive transformation is:
----
(defn substitute-token
  "Replace text 'token' with to."
  [to]
  #(update-in % [:content]
             (fn [c] (apply (partial replace-str "token" to) c))))
----


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