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-12 0:21

>>67
HOW FUKIN HARD IS IT TO WRITE A WRAPPER AROUND malloc DAT PRINTS SOMETHING 2 stderr N EXITS PROPERLY?
What's the point when you can just attach a debugger and see where it segfaults?
UR SOURCE FILE SURE AS FUK HAS MULTIPLE COUNTS OF ' ' CHARACTERS DAT CUD HAV BEEN COMPRESSED PROPERLY.
Please tell me you realize that this is a thread about toy run length encoding implementations. The algorithm is set in stone, no one cares about how efficient it is, we're just writing examples for shits and giggles.

>>68
But this is wrong you turd.
I'm pretty sure you can dig up a Dennis Ritchie quote somewhere about how a big part of why UNIX succeeded was that it just crashed loudly and dumped on serious errors whereas MULTICS had a complicated error handling system that considerably slowed down development and didn't do much in practice.

also only a retard would exit if the allocation failed on a non-critical operation and without saving the data
That is fair but this is not an enterprise Windows desktop line of business visual basic GUI workstation application, it's a fucking toy dozen-liner RLE function for a /prog/ thread. I thought you retards could mentally insert the boilerplate malloc checking bullshit if it really bothers you that much but I guess that was too much to expect.

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