chiark / gitweb /
src/classes.lisp: Fix `print-object' on `sod-initializer'.
[sod] / src / output-impl.lisp
index df42115b25aeac1801dfc450c34b867b52b54c9e..f668fef113141b94f8521fb7dc36c40d20e386cf 100644 (file)
@@ -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,6 +32,18 @@ (defmethod print-object ((item sequencer-item) stream)
   (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)
@@ -43,7 +55,7 @@ (defmethod add-sequencer-constraint ((sequencer sequencer) (constraint list))
                   (ensure-sequencer-item sequencer name))
                 constraint)))
     (with-slots (constraints) sequencer
-      (pushnew converted-constraint constraints :test #'equal))))
+      (pushnew converted-constraint constraints))))
 
 (defmethod add-sequencer-item-function ((sequencer sequencer) name function)
   (let ((item (ensure-sequencer-item sequencer name)))