Skip to content

Instantly share code, notes, and snippets.

@redraiment
Created December 25, 2012 02:50
Show Gist options
  • Save redraiment/4371436 to your computer and use it in GitHub Desktop.
Save redraiment/4371436 to your computer and use it in GitHub Desktop.
If test is true, evaluates then with binding-form bound to the value of test, if not, yields else.
(defmacro if-let ((var test) then &optional else)
"(if-let binding then else?)
binding => binding-form test
If test is true, evaluates then with binding-form bound to the value of
test, if not, yields else"
`(let ((,var ,test))
(if ,var
,then
,else)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment