anchor.diff:  	     ht)
       ht-out))
   
  -(defun qsort (lst)
  -  "Quicksort a list - in 7 lines"
  +(defun qsort (lst &key (key #'identity) (predicate #'<))
  +  "Quicksort a list - in 7 lines. Optional KEY and PREDICATE functions like SORT."
     (when lst
       (let* ((x (car lst))
              (xs (cdr lst))
  -           (lt (loop for y in xs when (< y x) collect y))
  -           (gte (loop for y in xs when (>= y x) collect y)))
  -      (append (qsort lt) (list x) (qsort gte)))))
  -
  -(defun qsort-swaps (lst)
  +           (lt (loop for y in xs when (funcall predicate (funcall key y) (funcall key x)) collect y))
  +           (gte (loop for y in xs when (not (funcall predicate (funcall key y) (funcall key x))) collect y)))
  +      (append (qsort lt :key key :predicate predicate) (list x) (qsort gte :key key :predicate predicate)))))
  +
  +#+null(defun qsort-swaps (lst)
     "Quicksort a list, counting the number of swaps a bubble-sort would have performed"
     (let ((swaps 0) ; initialize # swaps and result
           (res nil))
  
positive.code:             ;; append sorted lt, x, and sorted gte
              (setq res (append ltsort (list x) gtesort))))))
      (values res swaps))) ; return result and # of swaps
  
  (defun isorta (a &optional (pred #'<=) (l 0) (r (length a)))
    "Destructive Insertion sort 1D array. Also returns number of swaps a bubble sort would have done.
  
negative.code:           while has-swapped
            finally (return (values l num-swaps)))))
  
  (defun print-hash-key-or-val (kv stream)
    (format stream (typecase kv
  		   (keyword " :~a")
  		   (string " \"~a\"")
  		   (symbol " '~a")
  		   (list " '~a")
  		   (t " ~a")) kv))
  
  (defun printhash (h &optional (stream t))
    (format stream "#<HASH-TABLE~{~a~a~}>"
  	  (loop for k being the hash-keys in h using (hash-value v)
  	     collect (print-hash-key-or-val k nil)
  	     collect (print-hash-key-or-val v nil))))
  
  
  (defmacro lethash (keys h &body body)
    "Let form binding hash table entries to let variables names"
  