Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
;; 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