Advertisement
Guest User

Untitled

a guest
Dec 16th, 2015
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;; 4clojure Problem 121
  2. ;; https://www.4clojure.com/problem/121
  3.  
  4. (defn uce [[f & args]]
  5.   (let [args' (map #(cond (coll? %) (uce %)
  6.                          (symbol? %) (fn [m] (m %))
  7.                          :else (fn [m] %)) args)]
  8.     (fn [m]
  9.       (apply f (map #(% m) args')))))
  10.  
  11. ;; should evaluate to 2, but evaluates to 8
  12. ((uce '(/ a b)) '{b 8 a 16})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement