- new application problems beget new types
- types are heavy
- why don’t people use an existing type?
- want to branch on it (flow control)
- carry data
- new exception types lead to
- gen-class (+ precompilation)
- Java classes in Clojure projects
- use big things to solve small problems
- condition library (e.g. Contrib Condition) when all you want is data
- exceptions when all you want is control flow
- idiomatic on many JVM languages
- don't have composite returns or dynamic binding
- can't troubleshoot problems
- info is gone when call stack unwinds
Document dynamic binding as the "Clojure Way" to do out-of-band-control flow that is often done via exceptions on other JVM languages.
- find likely place within Clojure or Contrib and implement examplar
- write docs and tutorial
- add "control flow" link from exception handling parts of Clojure docs
- define a standard vocabulary for data-izing the information in a clojure exception
- package in fns
- do not call these fns automatically
- maybe provide REPL helpers that do
- other parts of clj-stactkrace (color printing etc.) should remain tool features
- open questions
- what do the REPL fns look like?
- might start with the data and wait to see how they get used
Ad hoc conditions
- could unify with Java exceptions, or not
- could include data-carrying exception, or not
Pattern Matching Conditions
Pattern matching (a la Matchure), plus exceptions as data, plus dynamic binding.