Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. (defmacro with-context (&body body)
  2. `(let ((context (make-array 4 :element-type 'fixnum
  3. :initial-contents '(0 1 2 3))))
  4. ,@body))
  5.  
  6. (defun test-a ()
  7. (with-context
  8. (setf (aref context 3)
  9. (+ (aref context 0) (aref context 1)))
  10. context))
  11.  
  12. (defun context (n)
  13. (aref context n))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement