Skip to content

Instantly share code, notes, and snippets.

@mpontus
Created January 17, 2015 06:25
Show Gist options
  • Save mpontus/41285536ff60d58cea96 to your computer and use it in GitHub Desktop.
Save mpontus/41285536ff60d58cea96 to your computer and use it in GitHub Desktop.
(defun read-list ()
(if (not (eq ?\( (following-char)))
(read (current-buffer))
(forward-char 1)
(prog1
(let (elements)
(while (not (memq (following-char) '(?\) ?\.)))
(push (read (current-buffer)) elements))
(setq elements (nreverse elements))
(if (eq ?\. (following-char))
(nconc elements (read-list))
elements))
(forward-char 1))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment