Fork me on GitHub
#babashka
<
2021-11-10
>
Imdad Ahmed11:11:09

Is there a way to pipe pbpaste to bb evaluation. I.e pbpaste | bb -e "pprint" or something similar?

Imdad Ahmed11:11:58

Nevermind, found it: pbpaste | bb -e "(println *input*)"

borkdude11:11:22

You can also use slurp + *in*

👍 1
hugod13:11:48

I’m assuming that java.net.URLClassLoader is something that should not be added to babashka.

hugod13:11:49

Used by tools.build compile-clj task via tools.namespace

borkdude13:11:40

How is it used to do what?

hugod14:11:04

just to get the classpath, iiuc

hugod14:11:16

There’s an instance check and a call to .getURLs. And ClassLoader is used for .getParent.

borkdude15:11:41

oh so it's being pulled in via tools.namespace?

borkdude15:11:06

It seems tools build doesn't actually use the classloader part from tools.namespace

borkdude15:11:12

it only searches within a directory

borkdude15:11:20

so perhaps that part can also forked and omitted

borkdude16:11:20

@U0HFRSY0M I made a fork of tools.namespace, for now I commented out the dependency on tools.classpath and jar stuff. I think we can make that work as well, but tools.build only uses directory stuff. Also I made a change in SCI and pushed it to the tools-build branch of bb. https://github.com/borkdude/tools.namespace/tree/tools.bbuild

borkdude16:11:53

$ clojure -M:babashka/dev -cp src/main/clojure -e "(require '[clojure.tools.namespace.find :as f]) (f/find-namespaces-in-dir (io/file \".\"))"
(clojure.tools.namespace clojure.tools.namespace.dependency clojure.tools.namespace.dir clojure.tools.namespace.file clojure.tools.namespace.find clojure.tools.namespace.move clojure.tools.namespace.parse clojure.tools.namespace.reload clojure.tools.namespace.repl clojure.tools.namespace.track clojure.tools.namespace.dependency-test clojure.tools.namespace.dir-test clojure.tools.namespace.find-test clojure.tools.namespace.move-test clojure.tools.namespace.parse-test clojure.tools.namespace.test-helpers)

hugod17:11:41

Thanks - I’ll try it later

hugod22:11:54

grr, its using clojure.lang.Compiler/munge

hugod22:11:10

seems pretty innocuous to add to bb

borkdude22:11:55

you can use clojure.main/munge instead

borkdude22:11:31

no, clojure.core/munge

hugod22:11:11

Just have javac left now

hugod22:11:44

Shelling out is the obvious replacement

borkdude22:11:59

you mean the java tool thing?

borkdude22:11:05

ToolSomething