anchor.diff:  (in-package :tw)
   
   
  +(defgeneric die (table person)
  +  (:documentation "Person dies and is removed from table."))
  +
  +
  +(defgeneric hear (table person from msg)
  +  (:documentation "Person hears a msg from another person."))
  +
  +
  +(defgeneric shout (table person msg)
  +  (:documentation "Person shouts msg"))
  +
  +
   (defparameter *genid-table* -1)
   
   (defclass table (world)
     ((ds::id
       :initform (incf *genid-table*))
   
  -   (chairs
  -    :initarg :chairs
  -    :initform (error "missing :chairs")
  -    :accessor chairs-of
  -    :type list
  -    :documentation "List of chairs.")
  -
      (persons
       :initarg :persons
  -    :initform (error "missing :persons")
       :accessor persons-of
  -    :type list
  -    :documentation "List of persons.")))
  +    :type hash-table
  +    :documentation "Hash table of persons, indexed by their ids")))
   
   
   (defparameter *genid-person* -1)
  
positive.code:     :initform (incf *genid-table-event*))))
  
  
  (defmethod !transform ((dest table) (source table))
    (setf (chairs-of dest) (chairs-of source))
    (setf (persons-of dest) (persons-of source))
    (call-next-method))
  
  
  (defmethod clone ((tab table))
    (!transform (make-instance 'table
  			     :events nil
  			     :chairs nil
  			     :persons nil)
  	      tab))
  
  
  (defparameter *geppo* (make-instance 'person :name "Geppo"))
  (defparameter *claudia* (make-instance 'person :name "Claudia"))
  (defparameter *verruca* (make-instance 'person :name "Verruca"))
  
  (defparameter *table-events*
    (list (make-instance 'table-event :time 3
  		       :!action (lambda (world)
  				  (format t
  "Geppo does something in world ~a." (id-of world))))))
  
  (defparameter *table*
    (make-instance 'table
  		 :persons (list *geppo* *claudia* *verruca*)
  		 :chairs (list (make-instance 'chair))
  		 :events *table-events*))
negative.code: 
     (name
      :initarg :name
      :accessor name-of
      :type string
      :documentation "Name of this person.")
  
     (life-points
      :initarg :life-points
      :accessor life-points-of
      :type fixnum
      :documentation "When 0, person dies.")))
  
  
  (defparameter *genid-table-event* -1)
  