Advertisement
Guest User

Untitled

a guest
Jul 27th, 2020
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 0.27 KB | None | 0 0
  1. (defmacro example (v &body body)
  2.   (let ((sym (intern "FOO")))
  3.     `(let ((,sym ,v))
  4.        ,@body)))
  5. #|
  6. CL-USER> (example 1 foo)
  7. 1
  8. CL-USER> (defpackage :bar (:use :cl))
  9. #<PACKAGE "BAR">
  10. CL-USER> (in-package :bar)
  11. #<PACKAGE "BAR">
  12. BAR> (cl-user::example 1 foo)
  13. 1
  14. |#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement