This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-03-26
Channels
- # announcements (3)
- # architecture (53)
- # babashka (6)
- # beginners (101)
- # bitcoin (3)
- # calva (4)
- # cider (3)
- # clara (7)
- # cljdoc (2)
- # cljsrn (14)
- # clojure (104)
- # clojure-europe (96)
- # clojure-germany (21)
- # clojure-nl (6)
- # clojure-serbia (3)
- # clojure-spain (1)
- # clojure-uk (13)
- # clojuredesign-podcast (4)
- # clojurescript (14)
- # cursive (5)
- # data-science (19)
- # datomic (16)
- # emacs (15)
- # fulcro (33)
- # graalvm (5)
- # honeysql (3)
- # instaparse (2)
- # jobs (3)
- # lsp (82)
- # malli (2)
- # off-topic (11)
- # pedestal (4)
- # polylith (62)
- # practicalli (4)
- # shadow-cljs (56)
- # tools-deps (53)
- # vim (17)
- # xtdb (53)
I'm in the process of designing a task-executor DSL.
Example:
{:tasks {:clean [:shell "rm" "-rf" "target"]}}
I want to be able to give a task a description and possibly more options. So I thought I can do:
{:tasks {:clean [:shell {:task/description "foo"} "rm" "-rf" "target"]}}
but this reads a bit weird, because I expect :shell
to get shell-related options and not some general task options.
One alternative I came up with:
{:tasks {:clean ^{:task/description "foo"} [:shell "rm" "-rf" "target"]}}
A bit ugly maybe, but semantically correct: the metadata is about the task. However, processing EDN with metadata, it can be done, but it might lead to confusion.
The other alternative, an explicit :task
wrapper if you want to provide options:
{:tasks {:clean [:task {:description "foo"} [:shell "rm" "-rf" "target"]]}}
I wonder if you came across similar problems when designing malli, I'd love to hear your feedback.