Skip to content

Instantly share code, notes, and snippets.

@knorth55
Last active October 12, 2016 21:10
Show Gist options
  • Save knorth55/f8ef91a8657a063e1f7e221631b5db00 to your computer and use it in GitHub Desktop.
Save knorth55/f8ef91a8657a063e1f7e221631b5db00 to your computer and use it in GitHub Desktop.
(defun read-file-into-string (filename)
(with-open-file (f filename :direction :input)
(let (buf (str-list nil))
(while (setq buf (read-line f nil))
(setq str-list (append str-list (list (format nil buf)))))
(reduce #'(lambda (x y) (concatenate string x y)) str-list))))
(read-file-into-string "sample.json")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment