anchor.diff:                    (append old (list definition)))
                 changed t)))))
   
  -(defun dictionary-read (word)
  -  (bt:with-lock-held ((lock *dictionary*))
  -    (gethash (string-downcase word) (hash *dictionary*))))
  -
  -(defun dictionary-delete (word nth)
  +(defun definitions-read (word)
  +  (bt:with-lock-held ((lock *definitions*))
  +    (gethash (string-downcase word) (hash *definitions*))))
  +
  +(defun definitions-delete (word nth)
     (setf word (string-downcase word))
  -  (with-slots (lock hash changed) *dictionary*
  +  (with-slots (lock hash changed) *definitions*
       (bt:with-lock-held (lock)
         (let ((old (gethash word hash)))
           (setf (gethash word hash) (remove-nth nth old)
  
positive.code:                                    format-string)
           args))
  
  ;;; Dictionary
  
  (defclass dictionary (eval-bot)
    ((hash :reader hash :initform (make-hash-table :test #'equal))
     (lock :reader lock :initform (bt:make-lock "dictionary"))
     (changed :accessor changed :initform nil)))
  
  (defvar *dictionary* (make-instance 'dictionary))
  
  (defun insert-before-nth (n new-item list)
    (cond ((null list) (list new-item))
  
negative.code:         (unless (gethash word hash)
            (remhash word hash))))))
  
  (defvar *definitions-pathname*
    (merge-pathnames #p "definitions.lisp" (user-homedir-pathname)))
  
  (defun definitions-load ()
    (with-standard-io-syntax
      (let ((*read-eval* nil))
        (handler-case
            (with-open-file (file *definitions-pathname*
                                  :direction :input
                                  :if-does-not-exist :error)
              (bt:with-lock-held ((lock *definitions*))
                (loop :for expr := (read file nil)
                      :while expr
                      :do (setf (gethash (first expr) (hash *definitions*))
                                (rest expr))))
              (send :terminal "Definitions loaded."))
  
          (file-error (c)
            (send :terminal (format nil "~A: ~A" (type-of c) c))
            (send :terminal "Load definitions failed."))))))
  
  (defun definitions-save ()
    (with-standard-io-syntax
      (handler-case
          (with-open-file (file *definitions-pathname*
                                :direction :output
                                :if-exists :rename)
            (format file ";;; Eval-bot definitions~%")
            (bt:with-lock-held ((lock *definitions*))
              (loop :for key :being :each :hash-key :in (hash *definitions*)
                    :using (hash-value value)
                    :do (write (cons key value) :stream file)
                    (terpri file))
              (setf (changed *definitions*) nil))
            (send :terminal "Definitions saved."))
  
        (file-error (c)
          (send :terminal (format nil "~A: ~A" (type-of c) c))
          (send :terminal "Save definitions failed.")))))
  
  ;;; General maintainer
  
  