Skip to content

Instantly share code, notes, and snippets.

@cgrand
Created April 12, 2017 16:11
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save cgrand/8768fa4fa2691d62b6215351c9b08da2 to your computer and use it in GitHub Desktop.

That's the kind of code that I'd like to make work across lumo & planck (and ideally any bootstrapped)

Is this unreasonable? Do you see any objection or technical issue with that?

  (def repl
    (letfn [(rep []
              (println (str (ns-name *ns*)) "=>")
              (read (fn [form ex]
                      (if ex
                        (caught ex)
                        (eval form
                          (fn [val ex]
                            (if ex
                              (caught ex)
                              (do
                                (prn val)
                                (rep)))))))))
            (caught [ex]
              (binding [*print-fn* *print-err-fn*]
                (prn ex)))]
      rep))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment