This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-03-05
Channels
- # announcements (1)
- # asami (1)
- # babashka (7)
- # beginners (11)
- # biff (2)
- # calva (7)
- # cider (1)
- # clara (5)
- # clj-kondo (223)
- # clojure (83)
- # clojure-boston (3)
- # clojure-conj (1)
- # clojure-europe (9)
- # clojure-uk (1)
- # clojurescript (11)
- # cursive (76)
- # emacs (30)
- # figwheel-main (2)
- # fulcro (13)
- # hyperfiddle (6)
- # lsp (6)
- # malli (2)
- # nyc (4)
- # off-topic (78)
- # practicalli (9)
- # reitit (4)
- # sci (20)
- # shadow-cljs (49)
- # sql (9)
- # xtdb (5)
Does there happen to be any tool that converts clj
+ flags invocations to deps.edn entries?
Can you explain what you mean by that?
When I have something like this:
clj \
-Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.9.0"}}}' \
-A:reveal \
-M -m nrepl.cmdline --middleware '[vlaaad.reveal.nrepl/middleware]'
my assumption is that with the exception of the alias -A
definition, all of these options have some equivalent form that can be used in a deps.edn configuration.
I'm wondering if there is some helper tool that helps with this cli<->deps.edn translation.-M
with an alias would include :main-opts
which is where you'd put ["-m" "nrepl.cmdline" "--middleware" "[vlaad.reveal.nrepl/middleware]"]
- is that what you're asking?
This can't really be automated by a tool since the aliases you'd need to add and how they are combined needs to be decided by a human.
Thanks, @U04V70XH6.
There is a large collection of aliases you can use / copy / be inspired by at https://github.com/practicalli/clojure-deps-edn (the readme also has a link to Sean's aliases too)

Hello all! I have this map, with n elements.
(def m {:01 12341241234, :02 5489348, :03 45799 ....etc})
I also have n functions. How can I map my functions their corresponding elements?
(fn1 (:01 m))
(fn2 (:02 m))
.
.
.
(fnX (:X m))
To be more specific, is there a way to store functions in a map?"is there a way to store functions in a map?"
Sure, functions are just data, like the numbers in your map m
. I like the name, btw. 🙂
Did you try it and it not go well?
You can store a function in a map, but not a macro.
user=> (def m {:map map})
#'user/m
user=> ((:map m) identity [1 2 3])
(1 2 3)
user=> (def m {:and and})
Syntax error compiling at (REPL:1:1).
Can't take value of a macro: #'clojure.core/and
Thanks. @U0PUGPSFR I did, but failed for some reason. Now it seems to work. Maybe I was too tired!