This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-03-20
Channels
- # announcements (5)
- # asami (162)
- # babashka (15)
- # beginners (1)
- # bitcoin (1)
- # calva (10)
- # chlorine-clover (3)
- # cider (1)
- # clj-kondo (4)
- # cljfx (10)
- # cljs-dev (1)
- # cljsrn (7)
- # clojure (38)
- # clojure-europe (69)
- # clojure-germany (2)
- # clojure-serbia (1)
- # clojurescript (22)
- # community-development (2)
- # conjure (1)
- # core-async (2)
- # cursive (14)
- # datahike (4)
- # fulcro (7)
- # graalvm (34)
- # helix (13)
- # honeysql (3)
- # lsp (134)
- # meander (56)
- # membrane (1)
- # off-topic (35)
- # practicalli (31)
- # releases (4)
- # rewrite-clj (5)
- # tools-deps (3)
- # vscode (6)
- # xtdb (8)
@grazfather I settled on :and-do
and :or-do
:
(testing ":and-do failing"
(with-config {:tasks {:div-by-zero {:task/type :babashka
:args ["-e" "(/ 1 0)"]}
:sum {:task/type :babashka
:args ["-e" "(+ 1 2 3)"]}
:all {:task/type :babashka
:args [:do :div-by-zero :and-do :sum]}}}
(is (thrown-with-msg? Exception #"Divide"
(bb :all)))))
(testing ":or-do succeeding"
(with-config {:tasks {:div-by-zero {:task/type :babashka
:args ["-e" "(/ 1 0)"]}
:sum {:task/type :babashka
:args ["-e" "(+ 1 2 3)"]}
:all {:task/type :babashka
:args [:do :div-by-zero :or-do :sum]}}}
(is (= 6 (bb :all)))))
which may not be the correct name either, since :or
will imply something like short-cutting on the first non-failing one, but I was thinking of ||
in the shell. Maybe I should have another one... :always-do
?
or-do makes sense to me but I get how it could sound confusing
it could be misleading in a few ways
and-do might imply short-circuiting (do the first that succeeds and stop)
:then-do
?