 
 ;;; Code:
 
-;; State ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;; State ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 (defvar multi/-method-branches (make-hash-table)
   "A dictionary of dictionaries of branches.
 

for the branches in a multi-method match the dispatch value."
  `(multi/-make-multi-method-fallback ',name (lambda ,arguments ,@forms)))

(defun multi-remove-method (name premise)
  "Removes the branch with the given premise from the multi-method."
  (remhash premise (gethash name multi/-method-branches)))

(defun multi-remove-method-fallback (name)
  "Removes the defined fallback branch for the multi-method."
  (remhash name multi/-method-fallbacks))


;; Helper functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun multi/-make-multi-method (name)
  (puthash name (make-hash-table :test 'equal)
     multi/-method-branches))

(defun multi/-make-multi-method-branch (name premise lambda)
  (puthash premise lambda
     (gethash name multi/-method-branches)))

(defun multi/-make-multi-method-fallback (name lambda)
  (puthash name lambda multi/-method-fallbacks))

(defun multi/-dispatch-with (name f)
  (lambda (&rest args)

invoked in case none of the premises for the defined branches match.")


;;;; API ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defmacro defmulti (name arguments &rest forms)
  "Defines a new multi-method and a dispatch function."
  (declare (doc-string 3)
