(in-package :polyominos) (defstruct action poly-symbol x y rot) (defvar *action-stack* nil "Stack of preallocated actions.") (defun reset-actions () (setq *action-stack* (make-array 1000 :fill-pointer 1000)) (map-into *action-stack* #'make-action)) (defun action-alloc () (if (= 0 (length *action-stack*)) (error 'stack-exhausted) (vector-pop *action-stack*))) (defun action-release (action) (vector-push action *action-stack*)) ;; $Id: //info.ravenbrook.com/user/ndl/lisp/contest/entries/anthony-juckel/solution2/actions.lisp#1 $