Created
January 17, 2015 06:25
-
-
Save mpontus/41285536ff60d58cea96 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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