This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-01-07
Channels
- # announcements (4)
- # babashka (20)
- # beginners (167)
- # calva (1)
- # cider (18)
- # circleci (10)
- # clara (45)
- # clojure (85)
- # clojure-argentina (1)
- # clojure-europe (3)
- # clojure-finland (3)
- # clojure-greece (2)
- # clojure-italy (9)
- # clojure-nl (30)
- # clojure-spec (32)
- # clojure-survey (39)
- # clojure-uk (72)
- # clojurescript (12)
- # core-async (4)
- # data-science (3)
- # emacs (10)
- # figwheel-main (9)
- # fulcro (44)
- # graalvm (3)
- # jobs (12)
- # jobs-discuss (6)
- # joker (3)
- # juxt (1)
- # leiningen (4)
- # off-topic (23)
- # planck (5)
- # re-frame (4)
- # reitit (2)
- # remote-jobs (1)
- # shadow-cljs (43)
- # spacemacs (8)
- # test-check (19)
- # tools-deps (21)
you need FileSystem to get a UserPrincipalLookupService in order to look up a UserPrincipal in order to call (Files/setOwner path user-principal)
It is separation of responsibility. One class for each function and for each concept :rolling_on_the_floor_laughing:
I added some scripts to test babashka libs on CI with new builds of babashka: https://github.com/borkdude/babashka/tree/master/script/lib_tests More libs can be added.
I was thinking of making a alter-classpath
function which you can use to add things to the classpath dynamically in a script.
Then you could do something like:
(alter-classpath! (fn [cp] (str cp ":" (:out (shell/sh "clojure" "-Spath" "-Sdeps" ...)))))
in a script to dynamically add libs which you can then require?Would be handy IMO. Maybe also an equivalent to tools.deps add-lib
(https://insideclojure.org/2018/05/04/add-lib/)?
I was thinking about that, but I don't want t couple adding libraries with a specific build tool
E.g. one could also use https://github.com/borkdude/deps.clj/blob/master/deps.clj instead of clojure
Another scenario: You could for example also just curl some scripts into a directory and then add those dirs to the classpath
Makes sense indeed
alter-classpath
sounds interesting -- will there be an attempt to provide safe-guards somewhere regarding conflicting / problematic dependencies? (cf. alex miller's conj talk)
I don't think so. Babashka doesn't resolve any dependencies, it just receives a classpath made by whatever tool
Macroexpand now on bb master:
$ bb "(defmacro foo [x] \`[1 2 ~x]) (macroexpand '(foo 1))"
[1 2 1]
Hmm, it seems with the right amount of type hints we don't need to include the Unix specific classes: https://github.com/borkdude/babashka/commit/f1b3180c760c4e3e3c6c6fe5ce983888a642e3a0