←back to thread

Hofstadter on Lisp (1983)

(gist.github.com)
372 points Eric_WVGG | 1 comments | | HN request time: 0s | source
Show context
timonoko ◴[] No.41865389[source]
Maclisp goodness:

  (compress (reverse (explode x)))
Elisp much improved:

  (defun explode (x)
    (if (symbolp x) (setq x (symbol-name x)))
    (string-to-list x))
  (defun compress (x) (concat x))
replies(3): >>41865620 #>>41865873 #>>41869520 #
1. timonoko ◴[] No.41865873[source]
I was wrong: It was "implode" in Maclisp.

  (compress (reverse (explode 'ABC)))
  ;COMPRESS UNDEFINED FUNCTION OBJECT

  (implode (reverse (explode 'ABC)))
  CBA
The point being that I never learn any fancy string-processing commands. I just implement explode and compress.