anchor.diff:  
   ;; Errors
   (define-condition nickname-already-in-use (error)
  +  ((text :initarg :text :reader text)))
  +
  +(define-condition message-parse-error (error)
     ((text :initarg :text :reader text)))
   
   ;; IRC message classes
  
positive.code: 
  ;; Server logging
  
  (defun log-server (server port nick channels)
    "Run logging loop for specified server."
    (handler-bind ((nickname-already-in-use
                    #'(lambda (c)
                        (declare (ignore c))
                        (invoke-restart 'change-nick))))
      (let ((sock (connect server port nick channels)))
        (do ((line
              (read-line (usocket:socket-stream sock) nil)
              (read-line (usocket:socket-stream sock) nil)))
            ((not line))
          (format t "Received: ~A~%" line)
          (if (string-prefix-p "PING" line)
              (send-pong sock line)
              (restart-case
                  (let ((message (parse-message line)))
                    (process message))
                (continue () nil)
                (change-nick ()
                  (progn
                    (setf nick (concatenate 'string nick "-"))
                    (set-nick sock nick)))))))))
  
negative.code: (in-package #:zoglog)
  
  ;; Helper functions
  (defmacro send-cmd (stream tpl &rest args)
    "Send IRC command through STREAM."
    `(progn
       (format ,stream
               (concatenate 'string ,tpl "~C~C")
               ,@args #\return #\linefeed)
       (finish-output ,stream)))
  
  (defun set-nick (stream nick)
    "Set user name for server."
    (send-cmd stream "NICK ~a" nick)
    (send-cmd stream "USER ~a ~:*~a ~:*~a :~:*~a" nick))
  
  (defun string-prefix-p (string line)
    "Check if LINE starts with STRING."
    (let ((pos (search string line)))
      (and pos (= pos 0))))
  
  (defun send-pong (stream line)
    "Send 'PONG' in answer to 'PING' line throuck STREAM."
    (let ((data (string-trim '(#\space #\return #\newline)
                             (cadr (split-sequence #\colon line :count 2)))))
      (send-cmd stream "PONG :~a" data)))
  
  (defun split-once (line seq)
    "Split string LINE by sequence SEQ once."
  