anchor.diff:  (defun get-pattern-clusters (postcodes)
     "Constructs a list of clusters by a list of postcodes."
     (let ((table (make-hash-table :test #'equal))
  -        (clusters (list)))
  +        (clusters nil))
       (dolist (postcode postcodes)
         (let* ((trimmed-postcode (trim postcode))
  -             (pattern (get-postcode-pattern trimmed-postcode)))
  -        (unless (gethash pattern table)
  -          (setf (gethash pattern table) (make-cluster :key pattern)))
  -        (add-sample (gethash pattern table) trimmed-postcode)))
  +             (pattern (get-postcode-pattern trimmed-postcode))
  +             (cluster (gethash pattern table (make-cluster :key pattern))))
  +        (add-sample cluster trimmed-postcode)
  +        (setf (gethash pattern table) cluster)))
       (maphash #'(lambda (pattern cluster)
                    (declare (ignore pattern))
                    (push cluster clusters))
  
positive.code:   (ql:quickload "sqlite"))
  
  (defstruct cluster
    "A cluster of postcodes with the same pattern, i.e.  all six-digirs
     postcodes or all four-digits-two-letters postcodes."
    (key "") (num-samples 0) (samples (list)))
  
  (defun add-sample (cluster sample)
    "Adds a postcode sample to a cluster of samples."
    (push sample (slot-value cluster 'samples))
    (incf (slot-value cluster 'num-samples)))
  
  (defparameter *seps* '(#\Space #\Tab #\Newline #\Backspace #\Return #\Rubout #\Linefeed #\"))
  
  
negative.code: (defparameter *postcodes*
    (sqlite:with-open-database (db *db-path*)
      (let ((rows (sqlite:execute-to-list db "select value from tags where key=\"addr:postcode\";"))
            (result nil))
        ; Flattens rows into a single list.
        (dolist (row rows result)
          (dolist (value row)
            (push value result))))))
  
  (defparameter *clusters*
    (sort (get-pattern-clusters *postcodes*)
          #'(lambda (lhs rhs) (> (cluster-num-samples lhs)
                                 (cluster-num-samples rhs)))))
  
  (defparameter *total*
    (loop for cluster in *clusters*
       summing (cluster-num-samples cluster)))
  
  (format t "Total: ~a~%" *total*)
  (loop for cluster in *clusters*
     for prev-prefix-sum = 0 then curr-prefix-sum
     for curr-prefix-sum = (+ prev-prefix-sum (cluster-num-samples cluster))
  
     do (let ((key (slot-value cluster 'key))
              (num-samples (slot-value cluster 'num-samples))
  