Skip to content

Instantly share code, notes, and snippets.

@flambard
Created February 24, 2016 15:19
Show Gist options
  • Save flambard/3a990846ccde0f9ab5fb to your computer and use it in GitHub Desktop.
Save flambard/3a990846ccde0f9ab5fb to your computer and use it in GitHub Desktop.
Implementation of the 'use' construct described in the video Object-Oriented Programming is Bad by Brian Will
(defmacro precompiled-lambda (lambda-list &body body)
(compile nil `(lambda ,lambda-list ,@body)))
(defmacro use ((&rest vars) &body body)
`(funcall (precompiled-lambda ,vars ,@body) ,@vars))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment