Advertisement
Guest User

Untitled

a guest
Jul 27th, 2020
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 0.39 KB | None | 0 0
  1. (defmacro let-game ((game player) &body body)
  2.   `(let* ((player (gethash ,player ,game))
  3.           (opponent (gethash (not ,player) ,game)))
  4.      (declare (ignorable player))
  5.      (declare (ignorable opponent))
  6.      (macrolet ((hand (p) `(gethash "hand" (gethash ,p 'game)))
  7.                 (deck (p) `(gethash "deck" (gethash ,p game))))
  8.        ,@body)))
  9.  
  10. (let-game (x t) (print (deck t)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement