Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@eethann
Created August 25, 2015 16:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save eethann/ad315a1923e7ddebb459 to your computer and use it in GitHub Desktop.
Save eethann/ad315a1923e7ddebb459 to your computer and use it in GitHub Desktop.
;; 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