anchor.diff:      (channel)
       (:documentation "Events for channel commands."))
   
  -(defclass command-event (channel-event)
  -    ((%command :initarg :command :accessor command)
  -     (%cmd-args :initarg :cmd-args :accessor cmd-args))
  -    (:documentation "Event for commands."))
  -
   (defgeneric respond (event message &rest format-args)
     (:documentation "Respond to an event origin with the given message."))
   
  
positive.code:     (channel target reason)
      (:documentation "User kick event."))
  
  (define-event whois-user-event :RPL_WHOISUSER (event)
      (NIL nick username hostmask NIL realname)
      (:documentation "Event on WHOISUSER response."))
  
  (define-event whois-channels-event :RPL_WHOISCHANNELS (event)
      (NIL nick &rest channels)
      (:documentation "Event on WHOISCHANNELS response."))
  
  (define-event whois-server-event :RPL_WHOISSERVER (event)
      (NIL nick hostname description)
      (:documentation "Event on WHOISSERVER response."))
  
  (define-event whois-idle-event :RPL_WHOISIDLE (event)
      (NIL nick idle-time signon-time)
      (:documentation "Event on WHOISIDLE response."))
  
  (define-event whois-end-event :RPL_ENDOFWHOIS (event)
      (NIL nick)
      (:documentation "Event on ENDOFWHOIS response."))
  
  (define-event motd-event :RPL_MOTD (event)
      (NIL message)
      (:documentation "Event on a MOTD line."))
  
negative.code: (define-event motd-end-event :RPL_ENDOFMOTD (event) ()
      (:documentation "Event on a ENDOFMOTD line."))
  
  
  ;;;;;;;;;;;;;;;; AUTOGENERATED ;;;;;;;;;;;;;;;;;;;;;;;
  
  (defun print-generated-event-definition (name origin format comment)
    (setf name (string-trim '(#\Newline #\Linefeed #\Space) name))
    (setf origin (string-trim '(#\Newline #\Linefeed #\Space) origin))
    (setf format (string-trim '(#\Newline #\Linefeed #\Space) format))
    (setf comment (string-trim '(#\Newline #\Linefeed #\Space) comment))
    (let ((class-name (cl-ppcre:regex-replace-all "_" (string-downcase (subseq name 4)) "-"))
          (format (CL-PPCRE:REGEX-REPLACE-ALL "[\\n]" (cl-ppcre:regex-replace-all "_" (cl-ppcre:regex-replace-all "[<>:]" (string-downcase format) "") "-") " "))
          (comment (CL-PPCRE:REGEX-REPLACE-ALL "[ ]{2}" (CL-PPCRE:REGEX-REPLACE-ALL "[\\n]" comment " ") " ")))
      (format T "(define-event ~a-event :~a (event)~:[ ()~;~%    (~a)~]~%    (:documentation \"~a\"))~%~%" class-name name (> (length format) 1) format comment)))
  
  (defun generate-event-definitions (path)
    ($ (initialize path :type :HTML) "tbody tr" 
       (each #'(lambda (a) 
                 (print-generated-event-definition 
                  ($ a "td" (eq 1) (text) (node)) 
                  ($ a "td" (eq 2) (text) (node)) 
                  ($ a "td" (eq 3) (text) (node)) 
                  ($ a "td" (eq 4) (text) (node))) T)))
    NIL)
  