X-Git-Url: https://git.distorted.org.uk/~mdw/sod/blobdiff_plain/aa14a4cddcb96b681d5c19a2ec8bad382f43b264..91d9ba3cb6ed57640dc29c2b2e73bb89e2628484:/src/output-impl.lisp diff --git a/src/output-impl.lisp b/src/output-impl.lisp index 30d0c80..7842334 100644 --- a/src/output-impl.lisp +++ b/src/output-impl.lisp @@ -7,7 +7,7 @@ ;;;----- Licensing notice --------------------------------------------------- ;;; -;;; This file is part of the Sensble Object Design, an object system for C. +;;; This file is part of the Sensible Object Design, an object system for C. ;;; ;;; SOD is free software; you can redistribute it and/or modify ;;; it under the terms of the GNU General Public License as published by @@ -32,11 +32,22 @@ (print-unreadable-object (item stream :type t) (prin1 (sequencer-item-name item) stream))) +(defmethod shared-initialize ((sequencer sequencer) slot-names + &key (constraints nil constraintsp)) + (call-next-method) + (when constraintsp + (setf (slot-value sequencer 'constraints) + (mapcar (lambda (constraint) + (mapcar (lambda (name) + (ensure-sequencer-item sequencer name)) + constraint)) + (reverse constraints)))) + sequencer) + (defmethod ensure-sequencer-item ((sequencer sequencer) name) (with-slots (table) sequencer (or (gethash name table) - (setf (gethash name table) - (make-instance 'sequencer-item :name name))))) + (setf (gethash name table) (make-sequencer-item name))))) (defmethod add-sequencer-constraint ((sequencer sequencer) (constraint list)) (let ((converted-constraint