Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defn apply-map-fn [f ks]
- (let [params (->> (-> f meta :arglists first)
- (map keyword)
- (reduce #(conj %1 (ks %2)) [])
- (remove nil?))
- f-args-count (-> f meta :arglists first count)
- params-count (count params)]
- (if (= f-args-count params-count)
- (apply f params)
- (throw (str "You passed " params-count " param(s) to " (-> f meta :name) " when it takes " f-args-count)))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement