-
-
Save johan-carlsson/6aec54a93aafadd198dc7125779ce6f3 to your computer and use it in GitHub Desktop.
Revisions
-
johan-carlsson revised this gist
Jul 11, 2018 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -5,10 +5,11 @@ A beginner-friendly REPL that combines * [rebel-readline](https://github.com/bhauman/rebel-readline) * [Pyro](https://github.com/venantius/pyro) * [Expound](https://github.com/bhb/expound) * Nrepl ## Usage `clj -Sdeps '{:deps {friendly {:git/url "https://gist.github.com/johan-carlsson/6aec54a93aafadd198dc7125779ce6f3" :sha "f0b0b5e70235094bc210e95a780f8fd5895b6693"}}}' -m friendly` ## Credits -
johan-carlsson revised this gist
Jul 11, 2018 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -5,6 +5,7 @@ [clojure.spec.alpha :as s] [clojure.spec.test.alpha :as st] [clojure.stacktrace] [clojure.tools.nrepl.server :as n] [clojure.main])) (def printer (expound/custom-printer {:print-specs? false @@ -44,6 +45,5 @@ (set! s/*explain-out* printer) (st/instrument) (pyro/swap-stacktrace-engine!) (defonce server (n/start-server :port 7888)) (rebel-readline.clojure.main/repl :caught repl-caught)) -
johan-carlsson revised this gist
Jul 11, 2018 . 2 changed files with 5 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,6 @@ {:paths ["."] :deps {com.bhauman/rebel-readline {:mvn/version "0.1.4"} venantius/pyro {:mvn/version "0.1.2"} expound {:mvn/version "0.7.1"} org.clojure/tools.nrepl {:mvn/version "0.2.12"}}} 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 charactersOriginal file line number Diff line number Diff line change @@ -44,4 +44,6 @@ (set! s/*explain-out* printer) (st/instrument) (pyro/swap-stacktrace-engine!) (use '[clojure.tools.nrepl.server :only (start-server stop-server)]) (defonce server (start-server :port 7888)) (rebel-readline.clojure.main/repl :caught repl-caught)) -
bhb revised this gist
Jul 9, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,7 @@ A beginner-friendly REPL that combines ## Usage `clj -Sdeps '{:deps {friendly {:git/url "https://gist.github.com/bhb/2686b023d074ac052dbc21f12f324f18" :sha "418bf66fd96851cc55398b55d5a8aff65692f565"}}}' -m friendly` ## Credits -
bhb revised this gist
Jul 9, 2018 . 1 changed file with 8 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -17,13 +17,19 @@ el (when-not (zero? (count tr)) (aget tr 0)) ex-m (Throwable->map ex)] (binding [*out* *err*] (cond ;; If the output is a clojure spec issue... (::s/problems (:data ex-m)) ;; print expound output (do (println (str (re-find #"Call to .* did not conform to spec\:" (.getMessage ex)) "\n" (with-out-str (printer (:data ex-m)))))) (instance? clojure.lang.LispReader$ReaderException e) (println (:cause (Throwable->map e))) :else ;; otherwise print exception (println (str (if (instance? clojure.lang.Compiler$CompilerException ex) (str -
bhb revised this gist
Jul 8, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,7 @@ A beginner-friendly REPL that combines ## Usage `clj -Sdeps '{:deps {friendly {:git/url "https://gist.github.com/bhb/2686b023d074ac052dbc21f12f324f18" :sha "a6a6727f68d52d9024079bdd93fab87222993ae5"}}}' -m friendly` ## Credits -
bhb revised this gist
Jul 8, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,7 @@ A beginner-friendly REPL that combines ## Usage `clj -Sdeps '{:deps {friendly {:git/url "https://gist.github.com/bhb/2686b023d074ac052dbc21f12f324f18" :sha "2686b023d074ac052dbc21f12f324f18"}}}' -m friendly` ## Credits -
bhb revised this gist
Jul 8, 2018 . 1 changed file with 12 additions and 4 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,17 @@ # Friendly A beginner-friendly REPL that combines * [rebel-readline](https://github.com/bhauman/rebel-readline) * [Pyro](https://github.com/venantius/pyro) * [Expound](https://github.com/bhb/expound) ## Usage `clj -Sdeps '{:deps {friendly {:git/url "https://gist.github.com/bhb/2686b023d074ac052dbc21f12f324f18" :sha "c6b0b7cb0a30e2edbf7050c0119ef038cf0f0ac2"}}}' -m friendly` ## Credits Inspired by https://github.com/slipset/friendly I learned the technique of loading code via a gist from https://gist.github.com/athos/b68b15b08efedffaf14d8c020b125202 -
bhb revised this gist
Jul 8, 2018 . 3 changed files with 6 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ Inspired by https://github.com/slipset/friendly I learned the technique of loading code via a gist from https://gist.github.com/athos/b68b15b08efedffaf14d8c020b125202 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 charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,4 @@ {:paths ["."] :deps {com.bhauman/rebel-readline {:mvn/version "0.1.4"} venantius/pyro {:mvn/version "0.1.2"} expound {:mvn/version "0.7.1"}}} 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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,6 @@ (ns friendly (:require [pyro.printer :as pyro] [rebel-readline.clojure.main] [expound.alpha :as expound] [clojure.spec.alpha :as s] [clojure.spec.test.alpha :as st] @@ -37,4 +38,4 @@ (set! s/*explain-out* printer) (st/instrument) (pyro/swap-stacktrace-engine!) (rebel-readline.clojure.main/repl :caught repl-caught)) -
bhb revised this gist
Jul 6, 2018 . 1 changed file with 6 additions and 4 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,9 @@ # Usage `clj -Sdeps '{:deps {friendly {:git/url "https://gist.github.com/bhb/2686b023d074ac052dbc21f12f324f18" :sha "c6b0b7cb0a30e2edbf7050c0119ef038cf0f0ac2"}}}' -m friendly` # Credits Inspired by https://github.com/slipset/friendly I learned the technique of loading code via a gist from https://gist.github.com/athos/b68b15b08efedffaf14d8c020b125202 -
bhb revised this gist
Jul 6, 2018 . 2 changed files with 36 additions and 8 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,3 @@ {:paths ["."] :deps {venantius/pyro {:mvn/version "0.1.2"} expound {:mvn/version "0.7.1"}}} 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 charactersOriginal file line number Diff line number Diff line change @@ -1,12 +1,40 @@ (ns friendly (:require [pyro.printer :as pyro] [expound.alpha :as expound] [clojure.spec.alpha :as s] [clojure.spec.test.alpha :as st] [clojure.stacktrace] [clojure.main])) (def printer (expound/custom-printer {:print-specs? false :show-valid-values? true :theme :figwheel-theme})) (defn repl-caught [e] (let [ex (clojure.main/repl-exception e) tr (.getStackTrace ex) el (when-not (zero? (count tr)) (aget tr 0)) ex-m (Throwable->map ex)] (binding [*out* *err*] ;; If the output is a clojure spec issue... (if (::s/problems (:data ex-m)) ;; print expound output (do (println (str (re-find #"Call to .* did not conform to spec\:" (.getMessage ex)) "\n" (with-out-str (printer (:data ex-m)))))) ;; otherwise print exception (println (str (if (instance? clojure.lang.Compiler$CompilerException ex) (str (-> ex class .getSimpleName) " " (.getMessage ex) " ") (str " " (if el (clojure.stacktrace/print-stack-trace ex) "[trace missing]"))))))))) (defn -main [] (set! s/*explain-out* printer) (st/instrument) (pyro/swap-stacktrace-engine!) (clojure.main/repl :caught repl-caught)) -
bhb revised this gist
May 29, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -4,4 +4,4 @@ I learned the technique of loading code via a gist from https://gist.github.com/ Usage: `clj -Sdeps '{:deps {friendly {:git/url "https://gist.github.com/bhb/2686b023d074ac052dbc21f12f324f18" :sha "bb5806bd655d743f3b48b36ce83c0085a8d7c54a"}}}' -m friendly` -
bhb revised this gist
May 29, 2018 . 2 changed files with 6 additions and 4 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,3 @@ {:paths ["."] :deps {com.bhauman/rebel-readline {:mvn/version "0.1.3"} expound {:mvn/version "0.7.0"}}} 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 charactersOriginal file line number Diff line number Diff line change @@ -5,6 +5,8 @@ [clojure.spec.test.alpha :as st])) (defn -main [] (set! s/*explain-out* (expound/custom-printer {:print-specs? false :show-valid-values? true :theme :figwheel-theme})) (st/instrument) (rebel-readline.main/-main)) -
bhb revised this gist
Apr 27, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -4,4 +4,4 @@ I learned the technique of loading code via a gist from https://gist.github.com/ Usage: `clj -Sdeps '{:deps {friendly {:git/url "https://gist.github.com/bhb/2686b023d074ac052dbc21f12f324f18" :sha "9bd01f28522a0083c6a7428a871aa5fbb8070d1d"}}}' -m friendly` -
bhb revised this gist
Apr 27, 2018 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,3 @@ {:paths ["."] :deps {com.bhauman/rebel-readline {:mvn/version "0.1.2"} expound {:mvn/version "0.6.0"}}} -
bhb revised this gist
Feb 28, 2018 . 2 changed files with 7 additions and 4 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ Inspired by https://github.com/slipset/friendly I learned the technique of loading code via a gist from https://gist.github.com/athos/b68b15b08efedffaf14d8c020b125202 Usage: `clj -Sdeps '{:deps {friendly {:git/url "https://gist.github.com/bhb/2686b023d074ac052dbc21f12f324f18" :sha "cbc5b3c73d4788a25570f125e5f2de23a3d2bf5f"}}}' -m friendly` 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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,3 @@ (ns friendly (:require [rebel-readline.main] [expound.alpha :as expound] -
bhb revised this gist
Feb 28, 2018 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,7 @@ ;; Inspired by https://github.com/slipset/friendly ;; I learned the technique of loading code via a gist from ;; https://gist.github.com/athos/b68b15b08efedffaf14d8c020b125202 (ns friendly (:require [rebel-readline.main] [expound.alpha :as expound] -
bhb revised this gist
Feb 28, 2018 . No changes.There are no files selected for viewing
-
bhb created this gist
Feb 28, 2018 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ {:paths ["."] :deps {rebel-readline {:mvn/version "0.1.1-SNAPSHOT"} expound {:mvn/version "0.5.0"}}} 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ ;; Inspired by https://github.com/slipset/friendly (ns friendly (:require [rebel-readline.main] [expound.alpha :as expound] [clojure.spec.alpha :as s] [clojure.spec.test.alpha :as st])) (defn -main [] (set! s/*explain-out* (expound/custom-printer {:print-specs? false :show-valid-values? true})) (st/instrument) (rebel-readline.main/-main))