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

ahaha~

Name: Anonymous 2011-06-14 20:30

(defun trip (input)
       (let ((salt
          (subseq (concatenate 'string input "H..")
              1 3)))
         (setf salt (regex-replace-all "[^\.-z]" salt "."))
         (setf salt (translate ":;<=>?@[\\]^_`" "ABCDEFGabcdef" salt))
         (let ((res (crypt input salt)))
           (subseq res (- (length res) 10)))))

I'm writing an imageboard in Common Lisp.

Problem, /prog/?

Name: Anonymous 2011-06-14 22:17

>>1
Problem
I don't see why we would have anything against it. Lisp is quite popular here, but there have been a few haters coming in from the imageboards that tend to hate on popular things within some community (even if those things may not be popular outside the community).

As for your code, it looks needlessly imperative, I'd write it like this:


(defun crop-string-by-end (string &optional (amount 10))
  (subseq string (- (length string) amount)))

(defun trip (input &optional (salt "H.."))
  (crop-string-by-end
   (crypt input
    (translate ":;<=>?@[\\]^_`" "ABCDEFGabcdef"
     (regex-replace-all "[^\.-z]"
      (subseq (concatenate 'string input salt) 1 3) ".")))))

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