Skip to content

Instantly share code, notes, and snippets.

@eschulte
Created November 29, 2010 19:24
Show Gist options
  • Save eschulte/720413 to your computer and use it in GitHub Desktop.
Save eschulte/720413 to your computer and use it in GitHub Desktop.
Lisp interpreter in 4 lines of Clojure
#!/usr/bin/env clj-env
;; -*- mode: clojure -*-
(loop [expr ""]
(when-let [l (str expr " " (read-line))]
(recur (if (apply = (map (comp count #(filter (partial = %) l)) [\( \)]))
(do (println (eval (read-string l))) "") l))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment