add demunge
This commit is contained in:
parent
193bbc2888
commit
ab6ea2de08
2 changed files with 12 additions and 3 deletions
|
|
@ -17,6 +17,12 @@
|
||||||
babashka.impl.clojure.main
|
babashka.impl.clojure.main
|
||||||
(:refer-clojure :exclude [with-bindings]))
|
(:refer-clojure :exclude [with-bindings]))
|
||||||
|
|
||||||
|
(defn demunge
|
||||||
|
"Given a string representation of a fn class,
|
||||||
|
as in a stack trace element, returns a readable version."
|
||||||
|
[fn-name]
|
||||||
|
(clojure.lang.Compiler/demunge fn-name))
|
||||||
|
|
||||||
(defmacro with-bindings
|
(defmacro with-bindings
|
||||||
"Executes body in the context of thread-local bindings for several vars
|
"Executes body in the context of thread-local bindings for several vars
|
||||||
that often need to be set!: *ns* *warn-on-reflection* *math-context*
|
that often need to be set!: *ns* *warn-on-reflection* *math-context*
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
[babashka.impl.clojure.core :refer [core-extras]]
|
[babashka.impl.clojure.core :refer [core-extras]]
|
||||||
[babashka.impl.clojure.java.io :refer [io-namespace]]
|
[babashka.impl.clojure.java.io :refer [io-namespace]]
|
||||||
[babashka.impl.clojure.java.shell :refer [shell-namespace]]
|
[babashka.impl.clojure.java.shell :refer [shell-namespace]]
|
||||||
|
[babashka.impl.clojure.main :refer [demunge]]
|
||||||
[babashka.impl.clojure.stacktrace :refer [stacktrace-namespace print-stack-trace]]
|
[babashka.impl.clojure.stacktrace :refer [stacktrace-namespace print-stack-trace]]
|
||||||
[babashka.impl.csv :as csv]
|
[babashka.impl.csv :as csv]
|
||||||
[babashka.impl.pipe-signal-handler :refer [handle-pipe! pipe-signal-received?]]
|
[babashka.impl.pipe-signal-handler :refer [handle-pipe! pipe-signal-received?]]
|
||||||
|
|
@ -20,9 +21,9 @@
|
||||||
[clojure.string :as str]
|
[clojure.string :as str]
|
||||||
[sci.addons :as addons]
|
[sci.addons :as addons]
|
||||||
[sci.core :as sci]
|
[sci.core :as sci]
|
||||||
|
[sci.impl.interpreter :refer [eval-string*]]
|
||||||
[sci.impl.opts :as sci-opts]
|
[sci.impl.opts :as sci-opts]
|
||||||
[sci.impl.vars :as vars]
|
[sci.impl.vars :as vars])
|
||||||
[sci.impl.interpreter :refer [eval-string*]])
|
|
||||||
(:gen-class))
|
(:gen-class))
|
||||||
|
|
||||||
(sci/alter-var-root sci/in (constantly *in*))
|
(sci/alter-var-root sci/in (constantly *in*))
|
||||||
|
|
@ -229,7 +230,9 @@ Everything after that is bound to *command-line-args*."))
|
||||||
'clojure.core.async async-namespace
|
'clojure.core.async async-namespace
|
||||||
'clojure.data.csv csv/csv-namespace
|
'clojure.data.csv csv/csv-namespace
|
||||||
'cheshire.core cheshire-core-namespace
|
'cheshire.core cheshire-core-namespace
|
||||||
'clojure.stacktrace stacktrace-namespace})
|
'clojure.stacktrace stacktrace-namespace
|
||||||
|
'clojure.main {'demunge demunge}
|
||||||
|
'clojure.repl {'demunge demunge}})
|
||||||
|
|
||||||
(def bindings
|
(def bindings
|
||||||
{'java.lang.System/exit exit ;; override exit, so we have more control
|
{'java.lang.System/exit exit ;; override exit, so we have more control
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue