anchor.diff:                                         &key (bezier-draw-control-lines *bezier-draw-control-lines*)
                                               (bezier-draw-location-labels *bezier-draw-location-labels*))
     (let ((segments (mcclim-bezier:segments design)))
  -    (let ((p0 (slot-value (car segments) 'mcclim-bezier:p0)))
  +    (let ((p0 (slot-value (elt segments 0) 'mcclim-bezier:p0)))
         (let ((path (make-path (point-x p0) (point-y p0))))
  -        (loop for segment in segments
  -           do (with-slots (mcclim-bezier:p1 mcclim-bezier:p2 mcclim-bezier:p3) segment
  -                (curve-to path
  -                          (point-x mcclim-bezier:p1) (point-y mcclim-bezier:p1)
  -                          (point-x mcclim-bezier:p2) (point-y mcclim-bezier:p2)
  -                          (point-x mcclim-bezier:p3) (point-y mcclim-bezier:p3))))
  +        (map nil (lambda (segment)
  +                   (with-slots (mcclim-bezier:p1 mcclim-bezier:p2 mcclim-bezier:p3) segment
  +                     (curve-to path
  +                               (point-x mcclim-bezier:p1) (point-y mcclim-bezier:p1)
  +                               (point-x mcclim-bezier:p2) (point-y mcclim-bezier:p2)
  +                               (point-x mcclim-bezier:p3) (point-y mcclim-bezier:p3))))
  +             segments)
           (if filled
               (%medium-fill-paths medium (list path))
               (%medium-stroke-paths medium (list path)))
           (when (or bezier-draw-control-lines
                     bezier-draw-location-labels)
  -          (loop for segment in (mcclim-bezier:segments design)
  -             for i from 1
  -             do (with-slots ((p0 mcclim-bezier:p0)
  -                             (p1 mcclim-bezier:p1)
  -                             (p2 mcclim-bezier:p2)
  -                             (p3 mcclim-bezier:p3))
  -                    segment
  -                  (when bezier-draw-control-lines
  -                    (draw-point medium p0 :ink +blue+ :line-thickness 6)
  -                    (draw-point medium p1 :ink +red+ :line-thickness 6)
  -                    (draw-line  medium p0 p1 :ink +green+ :line-thickness 2)
  -                    (draw-point medium p2 :ink +red+ :line-thickness 6)
  -                    (draw-line  medium p1 p2 :ink +green+ :line-thickness 2)
  -                    (draw-point medium p3 :ink +blue+ :line-thickness 6)
  -                    (draw-line  medium p2 p3 :ink +green+ :line-thickness 2))
  -                  (when bezier-draw-location-labels
  -                    (draw-text medium (format nil "P~D ~D ~D" i (point-x p0) (point-y p0)) p0)
  -                    (draw-text medium (format nil "C~D ~D ~D" i (point-x p1) (point-y p1)) p1)
  -                    (draw-text medium (format nil "C~D ~D ~D" (1+ i) (point-x p2) (point-y p2)) p2)
  -                    (draw-text medium (format nil "P~D ~D ~D" (1+ i) (point-x p3) (point-y p3)) p3)))))))))
  +          (let ((i 0))
  +            (map nil (lambda (segment)
  +                       (incf i)
  +                       (with-slots ((p0 mcclim-bezier:p0)
  +                                    (p1 mcclim-bezier:p1)
  +                                    (p2 mcclim-bezier:p2)
  +                                    (p3 mcclim-bezier:p3))
  +                           segment
  +                         (when bezier-draw-control-lines
  +                           (draw-point medium p0 :ink +blue+ :line-thickness 6)
  +                           (draw-point medium p1 :ink +red+ :line-thickness 6)
  +                           (draw-line  medium p0 p1 :ink +green+ :line-thickness 2)
  +                           (draw-point medium p2 :ink +red+ :line-thickness 6)
  +                           (draw-line  medium p1 p2 :ink +green+ :line-thickness 2)
  +                           (draw-point medium p3 :ink +blue+ :line-thickness 6)
  +                           (draw-line  medium p2 p3 :ink +green+ :line-thickness 2))
  +                         (when bezier-draw-location-labels
  +                           (draw-text medium (format nil "P~D ~D ~D" i (point-x p0) (point-y p0)) p0)
  +                           (draw-text medium (format nil "C~D ~D ~D" i (point-x p1) (point-y p1)) p1)
  +                           (draw-text medium (format nil "C~D ~D ~D" (1+ i) (point-x p2) (point-y p2)) p2)
  +                           (draw-text medium (format nil "P~D ~D ~D" (1+ i) (point-x p3) (point-y p3)) p3))))
  +                 segments)))))))
   
   (defmethod medium-draw-bezier-design* ((medium render-medium-mixin)
                                          (design bezier-curve))
  
positive.code:   (- (* (realpart z) (point-y v))
       (* (imagpart z) (point-x v))))
  
  (defclass bezier-design (design) ())
  
  (defgeneric medium-draw-bezier-design* (stream design))
  
negative.code: (defmethod polygonalize ((path bezier-curve))
    (let ((segments (%segments path)))
      (make-polyline
       (apply #'append (list (slot-value (elt segments 0) 'p0))
               (map 'list #'polygonalize segments)))))
  
  (defmethod polygonalize ((area bezier-area))
    (let ((segments (segments area)))
      (make-polygon (apply #'append (map 'list #'polygonalize segments)))))
  
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  ;;;
  