If you put the aif code presented in onlisp in a package and try to use it in another you run in the problem that packagename:it is not external.
(in-package :packagename)
(defmacro aif (test-form then-form &optional else-form)
‘(let ((it ,test-form))
(if it ,then-form ,else-form)))
wanted call syntax
(in-package :otherpackage)
(aif (do-stuff)
(FORMAT t "~a~%" it)
(FORMAT t "just got nil~%"))
How can I fix this behavior in code, without making the variable it external in the package declaration and beeing able to access it just by it instead of packagename:it?