anchor.diff:          (progn 
             (format t "Could not find shader for ~a~%" name))))))
   
  -(defun force-redraw (viewer)
  -  (with-viewer-lock (viewer)
  -    (setf (slot-value viewer 'clgl::modified) t)))
  -
   (defun clear (viewer)
     (with-viewer-lock (viewer)
  -    (with-slots (objects to-cleanup modified) viewer
  +    (with-slots (objects to-cleanup) viewer
         (setf to-cleanup objects)
  -      (setf objects nil)
  -      (setf modified t))))
  -
  +      (setf objects nil))))
  +
  
positive.code: 
  (defun set-viewport (viewer new-viewport)
    (with-viewer-lock (viewer)
      (with-slots (viewport modified) viewer
        (setf viewport new-viewport))))
  
  (defun close-viewer (viewer)
    (with-viewer-lock (viewer)
      (with-slots (window-open should-close) viewer
        (when window-open
          (set should-close t)))))
  
  (defun add-object (viewer name object)
    (with-viewer-lock (viewer)
      (with-slots (objects modified) viewer
        (if-let ((item (assoc name objects)))
          (setf (cdr item) object)
          (push (cons name object) objects))
        (setf modified t))))
  
  (defun scale-object (viewer object-name scale)
    (with-viewer-lock (viewer)
      (with-slots (objects modified) viewer
        (when-let ((items (assoc object-name objects)))
          (nmscale (slot-value (cdr items) 'transformation) (vec3 scale scale scale))))))
  
  (defun translate-object (viewer object-name offset)
    (with-viewer-lock (viewer)
      (with-slots (objects modified) viewer
        (when-let ((items (assoc object-name objects)))
          (nmtranslate (slot-value (cdr items) 'transformation) offset)))))
  
  (defun rotate-object (viewer object-name vector angle)
    (with-viewer-lock (viewer)
      (with-slots (objects modified) viewer
        (when-let ((items (assoc object-name objects)))
          (nmrotate (slot-value (cdr items) 'transformation) vector angle)))))
  
  (defun rm-object (viewer name)
    (with-viewer-lock (viewer)
      (with-slots (objects to-cleanup modified) viewer
        (when-let ((items (assoc name objects)))
          (push items to-cleanup)
          (setf objects (remove name objects :key #'car))
          (setf modified t)))))
  
  (defun recompile-shaders (viewer name)
    (with-viewer-lock (viewer)
      (with-slots (objects to-cleanup modified) viewer
        (if-let ((items (assoc name objects)))
          (progn 
            (format t "Rebuilding shader for ~a~%" items)
  
negative.code:     (dolist (object objects)
        (render (cdr object) viewport))))
  
  (defmethod view-idle ((viewer viewer) window)
    (declare (ignorable viewer window))
    (with-slots (last-position first-click-position should-close objects to-cleanup to-refill to-recompile should-close viewport) viewer
  
      (when first-click-position
        (let* ((new-point (glfw:get-cursor-position))
               (win-size (glfw:get-window-size))
               (x-diff (/ (- (car new-point) (car last-position)) (car win-size)))
               (y-diff (/ (- (cadr new-point) (cadr last-position)) (cadr win-size))))
          (when (not (equal new-point last-position))
            (setf last-position new-point)
            (handle-mouse-drag viewport x-diff y-diff))))
  
      (dolist (object to-refill)
        (fill-buffers (cdr object)))
      (setf to-refill nil)
  
      (dolist (object to-recompile)
        (rebuild-shaders (cdr object)))
      (setf to-recompile nil)
  
      (dolist (object to-cleanup)
        (cleanup (cdr object)))
      (setf to-cleanup nil)
      (when should-close
        (set-window-should-close window))))
  
  (defmethod view-key-press ((viewer viewer) window key scancode action mod-keys)
    (declare (ignorable window key scancode action mod-keys))
    (with-slots (last-position first-click-position objects to-cleanup geometry-modified should-close viewport) viewer
      (cond ((and (eq key :escape) (eq action :press) click-position)
             (setf click-position nil)
             (setf last-position nil))
            ((and (eq key :escape) (eq action :press))
             (set-window-should-close window)))))
  
  (defmethod view-mouse-button ((viewer viewer) window button action mod-keys)
    (declare (ignorable window button action mod-keys))
    (with-slots (last-position first-click-position objects to-cleanup geometry-modified should-close viewport) viewer
      (let ((cpos (glfw:get-cursor-position window)))
        (cond ((and (eq button :left) (eq action :press) (null first-click-position))
               (setf first-click-position cpos)
               (setf last-position cpos))
  
              (first-click-position
               (let* ((new-point (glfw:get-cursor-position window))
                      (win-size (glfw:get-window-size window))
                      (x-diff (/ (- (car new-point) (car last-position)) (car win-size)))
                      (y-diff (/ (- (cadr new-point) (cadr last-position)) (cadr win-size))))
                 (when (not (equal new-point last-position))
                   (setf last-position new-point)
                   (handle-mouse-drag viewport x-diff y-diff))))
              ((and (eq button :left) (eq action :release) first-click-position)
               (setf last-position nil)
               (setf first-click-position nil))))))
  
  (defmethod  view-scroll ((viewer viewer) window x y)
    (declare (ignorable window x y))
    (with-slots (viewport) viewer
      (handle-scroll viewport (* 0.25 y))))
  
  
  (def-key-callback to-global-keyboard (window key scancode action mod-keys)
    (when *global-viewer*
      (view-keyboard *global-viewer* window key scancode action mod-keys)))
  
  (def-mouse-button-callback to-global-mouse (window button action mod-keys)
    (when *global-viewer*
      (view-mouse-button *global-viewer* window button action mod-keys)))
  
  (def-key-callback quit-on-escape (window key scancode action mod-keys)
    (declare (ignore window scancode mod-keys))
    (when *global-viewer*
      (view-keyboard *global-viewer* window key scancode action mod-keys)))
  
  (def-scroll-callback scroll-handler (window x y)
    (when *global-viewer*
      (handle-scroll *global-viewer* window x y)))
  
  (def-error-callback error-callback (message)
    (format t "Error: ~a~%" message))
  