anchor.diff:  (progn
     (defparameter *irc-channel* "#midymidybot")
     (defparameter *irc-connection* nil)
  +
  +  (defparameter *pong*)
  +  (setf *pong* 0)
   
     (defun correct-cljson-surrogate-pairs (wrong-string)
       (with-output-to-string (out)
  
positive.code: ;;;;------------------------------------------------
  
  (defparameter *tg-loop* nil)
  
  (defun bot-start ()
    (irc-reconnect)
    (setf *tg-loop* (sb-thread:make-thread #'tg-getupdate-loop)))
  
  (defun bot-halt ()
    (tryto (sb-thread:terminate-thread *tg-loop*))
    (tryto (irc-shutdown)))
  
  
negative.code:     (tryto
       (part *irc-connection* *irc-channel* "Bot shutdown"))
      (tryto (quit *irc-connection* "leaving")))
  
    (defun irc-check-connection ()
      (let ((ping-time (get-universal-time)))
        (ping *irc-connection* *irc-channel*)
        (sleep 20)
        (let ((pong-time *pong*))
          (if (> (- pong-time ping-time) 20)
              (irc-reconnect 1)
              nil))))
    )
  ;;;; -----------------------------------------
  
  