Created
December 3, 2011 03:30
-
-
Save llibra/1425903 to your computer and use it in GitHub Desktop.
anaphoric if for pointers of CFFI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; 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