Skip to content

Instantly share code, notes, and snippets.

View tomfaulhaber's full-sized avatar

Tom Faulhaber tomfaulhaber

View GitHub Profile
@borkdude
borkdude / cljrepl.scala
Last active August 22, 2019 18:44
Clojure REPL inside Scala program
~/dev/scala/cljrepl $ cat build.sbt
scalaVersion := "2.11.8"
libraryDependencies ++= Seq(
"org.clojure" % "clojure" % "1.8.0"
)
~/dev/scala/cljrepl $ cat src/main/scala/foo.scala
import clojure.java.api.Clojure
import clojure.java.api.Clojure.{`var` => cvar}
@nathanmarz
nathanmarz / gist:1246228
Created September 27, 2011 20:56
Exception cause predicate
;; Determine if any of the causes of the exception was of the specified type
(defn exception-cause? [klass ^Throwable t]
(->> (iterate #(.getCause ^Throwable %) t)
(take-while identity)
(some (partial instance? klass))
boolean))
comment delim "#\|" "\|#" multiline nested
comment start ";"
vardef SPECIALCHAR = '\\.'
environment string delim "\"" "\"" begin
specialchar = $SPECIALCHAR
end
# broken: