Skip to content

Instantly share code, notes, and snippets.

@robertpfeiffer
Created January 25, 2009 12:04
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 robertpfeiffer/51765 to your computer and use it in GitHub Desktop.
Save robertpfeiffer/51765 to your computer and use it in GitHub Desktop.
(defmacro deflayer [name & defs]
(let [bindings
(apply concat
(for [[name val] (partition 2 defs)]
[name `(let [~'proceed ~name] ~val)]))]
(print bindings)
`(defmacro ~name [binding-form# & body#]
(apply list binding-form# '~(vec bindings) body#))))
(defmacro with-layer [layer & body]
`(~layer binding ~@body))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment