anchor.diff:  (in-package :cl-patterns)
   
  +;;; general functionality
  +
   (defstruct scale name degrees tuning)
   
  -(defparameter *scales* (list))
  +(defparameter *scales* (list)
  +  "Plist of all defined scales.")
   
   (defun define-scale (name degrees &optional (tuning :et12) aliases)
     "Define a scale and add it to the *scales* list."
  
positive.code:                                (make-tuning :name name
                                              :tuning tuning
                                              :octave-ratio octave-ratio)))
      (map nil
           (lambda (x)
             (setf *tunings* (plist-set *tunings* x key)))
           aliases)))
  
  (defgeneric tuning (item))
  
  (defmethod tuning ((item symbol))
    (let ((tuning (getf *tunings* item)))
  
negative.code:            (setf *scales* (plist-set *scales* x key)))
           aliases)))
  
  (defun all-scales ()
    "Get a list of all defined scales."
    (loop :for i :in (keys *scales*)
       :unless (symbolp (getf *scales* i))
       :collect (scale i)))
  
  (defgeneric scale (item)
    (:documentation "Get a scale struct by name."))
  
  (defmethod scale ((item symbol))
    (let ((scale (getf *scales* item)))
  