Created
August 25, 2015 16:51
-
-
Save eethann/ad315a1923e7ddebb459 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; TODO need to refactor this to put the entire let into the macro and use gensym form to escape | |
;; http://www.braveclojure.com/writing-macros/#6_1__Variable_Capture | |
(defmacro apply-by-next-n-bar | |
"Schedule a function by n bars in the future" | |
[m bar-period & rest] | |
(let [ | |
next-bar-num (metro-next-periodic-bar m bar-period) | |
] | |
`(apply-by-bar ~m ~next-bar-num ~@rest) | |
) | |
) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment