anomalies
unless_modules
anomalies | unless_modules | |
---|---|---|
3 | 1 | |
174 | - | |
0.0% | - | |
10.0 | - | |
over 5 years ago | - | |
Clojure | ||
- | - |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
anomalies
-
Clojure in the Tyre Manufacturing Industry
I'll do my best but there might be better explanations around the web.
I think an illustrative example would be this repo:
https://github.com/cognitect-labs/anomalies
These are basically re-usable, namespaced keywords. You might decide to use them or something similar in your program/system and some people do. Pretty neat: Their semantics are documented in the readme and the little bit of code in the repo defines a spec here https://github.com/cognitect-labs/anomalies/blob/master/src/....
You can read it as: any map that has these keywords as defined in the spec is an "anomaly".
Specs are open, non-exclusive so you can add more stuff to your structure and they still conform. (Note that the double colon before the keywords just mean "the current namespace defined at the top".)
Note that you don't need to define a spec for namespaced keywords. It's just a utility that leverages them. By themselves they already say "I can be used in a global context".
---
These keywords can be used from anywhere and by themselves. You don't need to carry around their context for them to work or have meaning. To contrast: for example a JSON field in a nested context might only make sense in that specific nesting context. Clojure namespaces are by convention globally unique.
Some examples:
- `:my.domain.accounting/refnumber`
- `:my.domain.ui/color` defined as `(or :my.domain.ui/rgb :my.domain.ui/hsl)` etc.
- `:my.domain.person/name` defined as a string if at all
- `:my.domain.event/type`
-
How to handle errors or failed computations in clojure?
In this case i would typically use an exception which is caught at the layer that is calling into my handler, whether that's a standard ring handler or interceptor. I'd use exceptions similar to those describe in the cognitect anomalies library and map those to an error response at the level interacting with the request and calling my handler.
unless_modules
-
My template.
- unless modules room (labeled "R") is handy for making space in the rack, and for re-arranging lots of modules quickly
What are some alternatives?
farolero - Thread-safe Common Lisp style conditions and restarts for Clojure(Script) and Babashka.
vcvrack-packone - Modules for VCV Rack
anomalies - modules for vcv rack
anomalies-tools - Anomalies handling tools
failjure - Monadic error utilities for general use in Clojure(script) projects