; ## Can this be considered an essential function?

(defn scat
  "Returns a function taking a seq on which f is applied.
   To [scat]ter is an antonym of to [juxt]apose."
  [f]
  (partial apply f))

; # A motivating use case from clojurescript:

(def to-js
  "Makes a js object from a map"
  (comp (scat js-obj) (scat concat)))

; # Or even:

(defn compply
  "Composes functions, that take multiple args and produce a seq"
  [& fns]
  (apply comp (map scat fns)))

(def to-js
  "Makes a js object from a map"
  (compply js-obj concat))

(to-js
  {"regards" "kind"})

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