function definition macro in clojure

Viewed 116

I'm trying to make a macro that transform this:

(defn-check my-checked-function
  check-function
  [a A
   b B]
  (do-something a b))

into:

(defn my-checked-function [a b]
  {:pre [(= (check-function a) A) 
         (= (check-function b) B)]}
  (do-something a b))

I'm new to clojure, could anyone show me how to do that?

1 Answers
Related