This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-10-07
Channels
- # babashka (30)
- # beginners (49)
- # calva (22)
- # cider (9)
- # clara (2)
- # clj-commons (1)
- # cljdoc (1)
- # clojars (7)
- # clojure (153)
- # clojure-australia (2)
- # clojure-europe (45)
- # clojure-italy (3)
- # clojure-losangeles (1)
- # clojure-nl (17)
- # clojure-portugal (3)
- # clojure-uk (6)
- # clojurescript (21)
- # conjure (4)
- # copenhagen-clojurians (5)
- # cryogen (3)
- # cursive (19)
- # datahike (14)
- # datascript (4)
- # datomic (9)
- # events (5)
- # fulcro (23)
- # graalvm (1)
- # gratitude (4)
- # helix (2)
- # holy-lambda (5)
- # improve-getting-started (2)
- # jobs (10)
- # kaocha (1)
- # leiningen (1)
- # liquid (8)
- # membrane (81)
- # off-topic (88)
- # polylith (29)
- # quil (1)
- # reitit (2)
- # remote-jobs (8)
- # reveal (8)
- # sci (1)
- # shadow-cljs (14)
- # specter (4)
- # sql (5)
- # tools-build (11)
- # tools-deps (5)
I have a project structured as follows: | + --- deps.edn | + --- src <-- Some sources here | + ---+ more-code <-- Library sources here | | . + --- module1 <-- Source tree . + --- module2 . . . . I've tried using :paths ["src" "more-code"] in my deps.edn file (as well as :paths ["src"] deps:["more-code"}), but this doesn't seem to recursively search into the subdirectories of the more-code directory, because when I try to refer to a namespace in src/x.clj which has its namespace defined in (say) module2/foo/src/foo/core.clj, this namespace is not found. The only thing I've found that comes close to working seems to be using :extra-deps {foo/module1 {:local-root "more-code/module1/foo/src"} foo/module2 {:local-root "more-code/module2/bar/src"} ... <for all namespaces referenced in src>} which seems clunky, repetitive, and not maintainable, especially when the namespace structures south of the more-code tree become complex. What am I doing wrong?
@U0DTU8J83
• it is :local/root
, not :local-root
• :local/root
should point to another folder with a deps.edn
file.
• you can have many "some sources" folders, like src
, you can simply point ["src" "more-code/module1"]
is there a way to use an already-defined var for an input argument to a function defined via :exec-fn
?
If I have a namespace like this:
(ns foo.bar)
(defn my-func [{:keys [a b]}] (inc a))
(def my-val 3)
and an :aliases
map like this:
{
...
:my-func {:ns-default foo.bar
:exec-fn my-func
:exec-args {:a my-val}}
...}
I get the following error:
Execution error (ClassCastException) at foo.bar/my-func
class clojure.lang.Symbol cannot be cast to class java.lang.Number
Is there a way to tell exec-fn
to resolve the symbol at execution time, or is this not possible? It doesn't seem like the #'
reader macro works in edn, so I can't use that method to ensure the symbol is treated as a var.no, you can't do this, although you could wrap my-func in something else that uses my-val
That's the solution i landed on, but wanted to confirm. Thanks!