Skip to content

Instantly share code, notes, and snippets.

@steveshogren
Last active December 21, 2015 07:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steveshogren/6269182 to your computer and use it in GitHub Desktop.
Save steveshogren/6269182 to your computer and use it in GitHub Desktop.
(defmacro make-percents []
`(list ~@(map (fn [num]
(let [macro-name (symbol (str "if" num))]
`(defmacro ~macro-name [x# y#]
`(if (> ~~num (rand-int 100)) ~x# ~y#))))
(range 100))))
(make-percents)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment