Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

post you are run length encoding in lisp

Name: Anonymous 2014-10-05 3:18

critique mine pl0x:

(defun rle (str) ;run length encoding
(let ((i 0) c count out)
(while (< i (length str))
(if (eq c (elt str i))
(setq count (1+ count))
(when c
(setq out (append out (list (cons c count)))))
(setq c (elt str i))
(setq count 1))
(setq i (1+ i)))
(when c (setq out (append out (list (cons c count)))))
out))

Name: Anonymous 2014-10-11 22:14

>>63
Half the point of UNIX was that it crashed quickly on error instead of trying to handle every silly error condition and bloating the fuck out of the code for little gain.
Stupid then, stupid now.

That's why they are called ``hackers'' and not Professional Engineers.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List