fork(1) download
  1. (defpackage foo
  2. (:use #:cl)
  3. (:export #:aif #:it))
  4.  
  5. (defpackage bar
  6. (:use #:cl #:foo)
  7. (:export #:fwrite))
  8.  
  9. (in-package foo)
  10.  
  11. (defmacro aif (cond then else)
  12. `(let ((it ,cond))
  13. (if it ,then ,else)))
  14.  
  15. (in-package bar)
  16.  
  17. (defmacro fwrite (stream x)
  18. `(aif ,stream (format it "~a" ,x) nil))
  19.  
  20. (in-package cl-user)
  21.  
  22. (print (macroexpand '(bar:fwrite t "asd")))
Success #stdin #stdout 0.01s 27024KB
stdin
Standard input is empty
stdout
(LET ((FOO:IT T))
  (IF FOO:IT
      (FORMAT FOO:IT "~a" "asd")
      NIL))