Hi, folks.

I need a generalized version of clojure.core/format function, i.e. function 
that accepts a pattern like "-%s-%s-%s-", two functions and format args. It 
most return a 'formatted' seq. The first supplied function is called for 
each non-special character from the pattern and returns its uplifted 
version (wrapped in vector, for example), another function is called for 
each special character substitution which is then uplifted as well. So, to 
demonstrate its usage perspective:

(gen-format
  "-%s-%s-%s-"
  vector
  (fn [x] (vector x (get-some-meta-info x))
  :one
  :two
  :three)

Result: ([-] [:one some-meta-1] [-] [:two some-meta-2] [-] [:three 
some-meta-3] [-]).

Should I implement such an abstraction myself or there is something ready?

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