HomeAboutCodePastes

Paste on 2021-08-19T20:46:44

(let ((last (car lst))
      (last-count 0))
  (loop :for thing :int lst
        :as count := 1 :then (if (= last thing)
                                 (progn (setq last-count count)
                                        (incf count))
                                 1)
        :unless (= last thing)
          :collect (cons last last-count)
          :and :do (setq last thing)))

plain