Skip to content

Instantly share code, notes, and snippets.

@outworlder
Created January 26, 2011 22:46
Show Gist options
  • Select an option

  • Save outworlder/797669 to your computer and use it in GitHub Desktop.

Select an option

Save outworlder/797669 to your computer and use it in GitHub Desktop.
(defmacro maybe-require (package &rest body)
"Tries to load the specified package. If it succeeds, then body is executed (if provided)."
(if body
`(progn
(if (require ,package nil t)
(progn
,@body)))
`(require ,package nil t)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment