This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-02-10
Channels
- # announcements (2)
- # babashka (15)
- # beginners (174)
- # calva (16)
- # chlorine-clover (10)
- # clara (7)
- # clj-kondo (27)
- # cljdoc (10)
- # clojars (4)
- # clojure (50)
- # clojure-europe (10)
- # clojure-gamedev (3)
- # clojure-greece (1)
- # clojure-italy (4)
- # clojure-losangeles (1)
- # clojure-nl (16)
- # clojure-sg (1)
- # clojure-spec (7)
- # clojure-uk (41)
- # clojurescript (22)
- # data-science (15)
- # datascript (38)
- # datomic (2)
- # duct (15)
- # emacs (2)
- # fulcro (110)
- # funcool (9)
- # graphql (10)
- # jackdaw (8)
- # jobs (23)
- # joker (1)
- # leiningen (15)
- # luminus (1)
- # malli (20)
- # off-topic (26)
- # pathom (5)
- # pedestal (1)
- # reitit (19)
- # shadow-cljs (78)
- # spacemacs (2)
- # sql (52)
- # tools-deps (99)
- # vim (13)
sup! quick question: how to define functions on :injections
? My ~/.lein/profiles.clj looks like this, but add-dependency
is never available in my repl (`hashp.core` is loaded correctly, which is stranger for me)
{:user {:plugins [[lein-pprint "1.1.2"]
[com.jakemccrary/lein-test-refresh "0.23.0"]
[com.cemerick/pomegranate "0.4.0"]]
:dependencies [[fipp "0.6.14"]
[hashp "0.1.1"]
[com.cemerick/pomegranate "0.4.0"]]
:injections [(do
(require 'hashp.core)
(defn add-dependency [dep-vec]
(require 'cemerick.pomegranate)
((resolve 'cemerick.pomegranate/add-dependencies)
:coordinates [dep-vec]
:repositories (merge @(resolve 'cemerick.pomegranate.aether/maven-central)
{"clojars" ""}))))]
:test-refresh {:notify-command ["notify-send" "-t" "1000"]
:quiet true
:changes-only true}}}
the injections don't neccessarily happen in your init-ns do they?
my suspicion is that those requires happen in some other ns, before your ns is loaded, you use hashp.core
by its full name, so it just works
that's what I thought too, but the docs say: > Forms to prepend to every form that is evaluated inside your project.
that doesn't imply they ever run inside your ns
with a prepend, (require 'my-ns) (in-ns 'my.ns)
turns into (custom form) (require 'my.ns) (in-ns 'my.ns)
- I wouldn't expect a prepend to end up running code in your init-ns unless you explicitly make it do so
every form that is evaluated inside your project
isn't your repl, it's literally the forms in the project.clj file
@caio I bet what you want is :repl-options {:init ...}
- that code will run in your startup ns, when a new repl connection is made
and the lein docs make clear it is run in your startup ns