(defpackage foo
(:use #:cl)
(:export #:aif #:it))
(defpackage bar
(:use #:cl #:foo)
(:export #:fwrite))
(in-package foo)
(defmacro aif (cond then else)
`(let ((it ,cond))
(if it ,then ,else)))
(in-package bar)
(defmacro fwrite (stream x)
`(aif ,stream (format it "~a" ,x) nil))
(in-package cl-user)
(print (macroexpand '(bar:fwrite t "asd")))
KGRlZnBhY2thZ2UgZm9vCiAgKDp1c2UgIzpjbCkKICAoOmV4cG9ydCAjOmFpZiAjOml0KSkKCihkZWZwYWNrYWdlIGJhcgogICg6dXNlICM6Y2wgIzpmb28pCiAgKDpleHBvcnQgIzpmd3JpdGUpKQoKKGluLXBhY2thZ2UgZm9vKQoKKGRlZm1hY3JvIGFpZiAoY29uZCB0aGVuIGVsc2UpCiAgYChsZXQgKChpdCAsY29uZCkpCiAgICAgKGlmIGl0ICx0aGVuICxlbHNlKSkpCgooaW4tcGFja2FnZSBiYXIpCgooZGVmbWFjcm8gZndyaXRlIChzdHJlYW0geCkKICBgKGFpZiAsc3RyZWFtIChmb3JtYXQgaXQgIn5hIiAseCkgbmlsKSkKCihpbi1wYWNrYWdlIGNsLXVzZXIpCgoocHJpbnQgKG1hY3JvZXhwYW5kICcoYmFyOmZ3cml0ZSB0ICJhc2QiKSkp