Skip to content

Instantly share code, notes, and snippets.

@knorth55
Last active October 12, 2016 21:32
Show Gist options
  • Save knorth55/03d425b9ec377d9fbe3c746fa1ebf684 to your computer and use it in GitHub Desktop.
Save knorth55/03d425b9ec377d9fbe3c746fa1ebf684 to your computer and use it in GitHub Desktop.
(require :json-decode "package://roseus_mongo/euslisp/json/json-decode.l")
(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))))
(defun read-json-into-string (filename)
(json::parse-from-string (read-file-into-string filename)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment