Skip to content

Commit

Permalink
Creating a place for some design considerations...
Browse files Browse the repository at this point in the history
  • Loading branch information
hanjos committed Oct 23, 2023
1 parent 2698379 commit 7e1a2da
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions DESIGN.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# Some thoughts on design decisions and speculations
# Thoughts and speculations on design

## vars vs keywords
## 0.2.0-SNAPSHOT

### vars vs keywords

`org.sbrubbles.conditio` uses keywords as identifiers for conditions and restarts, whereas `org.sbrubbles.conditio.vars` uses vars. The end API is quite different, and I'm not sure which I prefer...

Using keywords:
* Requires building up some machinery, but I feel demonstrates the concept of conditions better.
* Requires building up some machinery, but I feel it's easier to understand and inspect; the data (conditions, available handlers and restarts) are explicit.

Using vars:
* Takes a lot of advantage of Clojure's preexisting functionality; so much the end result is effectively two macros, a condition and a function (`v/bind-fn`) that one could argue should be in Clojure's API directly.
* It's a very thin layer over Clojure's preexisting functionality; just a couple of helper macros (and function). That minimalism is very appealing.
* The concepts seem more... blurred together? For example, condition and signal are blurred together in defcondition, which effectively creates a specialized signal function.


0 comments on commit 7e1a2da

Please sign in to comment.