Skip to content

Instantly share code, notes, and snippets.

@lispm
Created August 21, 2013 17:57
Show Gist options
  • Save lispm/6297735 to your computer and use it in GitHub Desktop.
Save lispm/6297735 to your computer and use it in GitHub Desktop.
(defmacro new-flet (bindings &body body)
(loop with new-arg = (make-symbol "ARGS")
for (name f) in bindings
for new-name = (make-symbol (symbol-name name))
collect (list new-name f) into let-bindings
collect `(,name (&rest ,new-arg)
(declare (dynamic-extent ,new-arg))
(apply ,new-name ,new-arg))
into flet-bindings
finally (return
`(let ,let-bindings
(flet ,flet-bindings
,@body)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment