After some discussions we've noticed that we can introduce pipeline operators (for lack of abetter term). The idea is that a chain of commands, as it currently stand, lacks the expressiveness of boolean operations.
There are 2 approaches, either we allow sexp style syntax or a threading style. For example, calculators avoid that using Reverse Polish Notation. We don't need exactly that, we can do a thread macro style of syntax.
Some examples:
-
Sexp: blue --pipeline=(and (or build repl) dist)
-
Threading: blue buid -> repl -- dist
-
Sexp: blue --pipeline=(or (and configure build) (and help repl))
-
Threading: blue configure -- build -> help -- repl
-
Sexp: blue --pipeline=(or (and configure build) (and clean build) report-bug repl)
-
Threading: blue configure -- build -> clean -- build -> report-bug -> repl
So with this notation, the status value is always passed to the next operator for checking what to do.
The trick to reason about how to write the expressions is to think in CPS style. You reason about it from inside-out. So you think about the continuation of the operation.
Unless I'm missing something, this should cover all cases.
After some discussions we've noticed that we can introduce pipeline operators (for lack of abetter term). The idea is that a chain of commands, as it currently stand, lacks the expressiveness of boolean operations.
There are 2 approaches, either we allow sexp style syntax or a threading style. For example, calculators avoid that using [Reverse Polish Notation](https://en.wikipedia.org/wiki/Reverse_Polish_notation). We don't need exactly that, we can do a [thread macro](https://clojure.org/guides/threading_macros) style of syntax.
Some examples:
- Sexp: `blue --pipeline=(and (or build repl) dist)`
- Threading: `blue buid -> repl -- dist`
- Sexp: `blue --pipeline=(or (and configure build) (and help repl))`
- Threading: `blue configure -- build -> help -- repl`
- Sexp: `blue --pipeline=(or (and configure build) (and clean build) report-bug repl)`
- Threading: `blue configure -- build -> clean -- build -> report-bug -> repl`
So with this notation, the status value is always passed to the next operator for checking what to do.
The trick to reason about how to write the expressions is to think in CPS style. You reason about it from inside-out. So you think about the continuation of the operation.
Unless I'm missing something, this should cover all cases.