;;; -*-lisp-*- ;;; ;;; Output driver for SOD translator ;;; ;;; (c) 2009 Straylight/Edgeware ;;; ;;;----- Licensing notice --------------------------------------------------- ;;; ;;; This file is part of the Simple Object Definition system. ;;; ;;; SOD is free software; you can redistribute it and/or modify ;;; it under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 2 of the License, or ;;; (at your option) any later version. ;;; ;;; SOD is distributed in the hope that it will be useful, ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with SOD; if not, write to the Free Software Foundation, ;;; Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. (cl:in-package #:sod) ;;;-------------------------------------------------------------------------- ;;; Sequencing machinery. (defclass sequencer-item () ((name :initarg :name :reader sequencer-item-name) (functions :initarg :functions :initform nil :type list :accessor sequencer-item-functions)) (:documentation "Represents a distinct item to be sequenced by a SEQUENCER. A SEQUENCER-ITEM maintains a list of FUNCTIONS which are invoked when the sequencer is invoked. This class is not intended to be subclassed.")) ;;;-------------------------------------------------------------------------- ;;; Output preparation. (defvar *seen-announcement*) ;Keep me unbound! #+hmm (defmethod add-output-hooks :around (object reason sequencer &rest stuff) "Arrange not to invoke any object more than once during a particular announcement." (declare (ignore stuff)) (cond ((not (boundp '*seen-announcement*)) (let ((*seen-announcement* (make-hash-table))) (setf (gethash object *seen-announcement*) t) (call-next-method))) ((gethash object *seen-announcement*) nil) (t (setf (gethash object *seen-announcement*) t) (call-next-method)))) ;;;-------------------------------------------------------------------------- ;;; Utility macro. ;;;----- That's all, folks --------------------------------------------------