Skip to content

Instantly share code, notes, and snippets.

@llibra
Created December 3, 2011 03:30
Show Gist options
  • Save llibra/1425903 to your computer and use it in GitHub Desktop.
Save llibra/1425903 to your computer and use it in GitHub Desktop.
anaphoric if for pointers of CFFI
;; It's anaphoric if for pointers. If the first argument is NOT a null pointer,
;; evaluates the second argument. Otherwise evaluates third.
(defmacro aif/ptr (test then &optional else)
`(let ((it ,test))
(if (null-pointer-p it) ,else ,then)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment