Skip to content

Instantly share code, notes, and snippets.

@redraiment
Last active December 10, 2015 02:58
Show Gist options
  • Save redraiment/4371440 to your computer and use it in GitHub Desktop.
Save redraiment/4371440 to your computer and use it in GitHub Desktop.
When test is true, evaluates body with binding-form bound to the value of test.
(defmacro when-let ((var test) &body body)
"(when-let binding body)
binding => binding-form test
When test is true, evaluates body with binding-form bound to the value of test"
`(let ((,var ,test))
(when ,var
,@body)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment