anchor.diff:  ;; See if it's time to inject a scheduled event into the queue.
   (defun check-schedule (event-queue)
     (check-type event-queue schedule-mixin)
  -  (with-slots (schedule-time schedule) event-queue
  -    (when (and schedule-time (> (now) schedule-time))
  -      (let* ((event (pop schedule))
  -             (sheet (pop schedule)))
  -        (declare (ignore sheet))
  -        (setf schedule-time (pop schedule))
  -        (event-queue-prepend event-queue event)))))
  -
  -;;; ugh. FIXME when I work - build a priority queue or something
  +  (alexandria:when-let* ((schedule-time (event-schedule-time event-queue))
  +                         (execute-p (>= (now) schedule-time))
  +                         (entry (pop (event-queue-schedule event-queue))))
  +    (event-queue-append event-queue (schedule-entry-event entry))
  +    (if-let ((next-entry (first (event-queue-schedule event-queue))))
  +      (setf schedule-time (schedule-entry-time next-entry))
  +      (setf schedule-time nil))))
  +
   (defun schedule-event-queue (event-queue sheet event delay)
  +  (declare (ignore sheet))
     (check-type event-queue schedule-mixin)
     (with-slots (schedule-time schedule) event-queue
       (let ((alarm (+ (now) delay)))
         (cond
           ((null schedule)
  -         (setf schedule-time alarm)
  -         (push sheet schedule)
  -         (push event schedule))
  +         (push (make-schedule-entry :time alarm :event event) schedule)
  +         (setf schedule-time alarm))
           ((< alarm schedule-time)
  -         (push schedule-time schedule)
  -         (push sheet schedule)
  -         (push event schedule)
  +         (push (make-schedule-entry :time alarm :event event) schedule)
            (setf schedule-time alarm))
           (t
  -         (do* ((prev  (cdr schedule)  (cdddr prev))
  -               (point (cddr schedule) (cdddr point))
  -               (time  (car point)))
  -              ((or (null point)
  -                   (< alarm time))
  -               (setf (cdr prev)
  -                     (cons alarm (cons event (cons sheet (cdr prev))))))))))))
  +         (do* ((previous schedule (rest previous))
  +               (current  (rest schedule) (rest current))
  +               (entry #1=(first current) #1#))
  +              ((or (null current)
  +                   (< alarm (schedule-entry-time entry)))
  +               (setf (cdr previous)
  +                     (list* (make-schedule-entry :time alarm :event event) (cdr previous))))))))))
   
   ;;; EVENT-QUEUE protocol (not exported)
   
  
positive.code: 
  ;; Event queues
  
  (defclass schedule-mixin ()
    ((schedule-time
           :initform nil
           :accessor event-schedule-time
           :documentation "The next time an event should be scheduled.")
     (schedule
           :initform nil
           :accessor event-queue-schedule
           :documentation "Time ordered queue of events to schedule."))
    (:documentation "Experimental timer event extension."))
  
  (defun now ()
  
negative.code:                             ((null timeout) (- schedule-time (now)))
                              (T (min timeout (- schedule-time (now))))))
               (port (event-queue-port queue)))
          (when timeout (maxf timeout 0))
          (process-next-event port :timeout timeout)
          (check-schedule queue)
          (not (null (event-queue-head queue))))))
  