(in-package :polyominos) (defstruct action polyomino 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-stack* action)) ;; $Id: //info.ravenbrook.com/user/ndl/lisp/contest/entries/anthony-juckel/solution1/actions.lisp#1 $