P13

(de encode-direct (Lst)
   (make
      (while Lst
         (let (N 1  X)
            (while (= (setq X (pop 'Lst)) (car Lst))
               (inc 'N) )
            (link (if (= 1 N) X (list N X))) ) ) ) )

http://picolisp.com/wiki/?99p13

10jul10    abu