Skip to content

Instantly share code, notes, and snippets.

@steveshogren
Created August 19, 2013 13:34
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/6269163 to your computer and use it in GitHub Desktop.
Save steveshogren/6269163 to your computer and use it in GitHub Desktop.
;;before compilation
(defmacro ifWorkday [bigCalc1, bigCalc2]
`(if (workday (today))
~bigCalc1
~bigCalc2))
;; the call
(ifWorkday (+ 1 1) (otherBigCalc))
;;... after compilation...
(defmacro ifWorkday [(+ 1 1), (otherBigCalc)]
`(if (workday (today))
(+ 1 1)
(otherBigCalc)))
;; after compilation the call gets _transformed_ into:
(if (workday (today)) (+ 1 1) (otherBigCalc))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment