Fork me on GitHub
#conjure
<
2022-09-02
>
frankitox14:09:17

It's possible pretty print doesn't work in babashka?

borkdude14:09:41

@franquito Should work, what is the problem?

borkdude14:09:03

I'll make a thread

frankitox15:09:03

It shows everything in one line :thinking_face:

frankitox15:09:16

a git repository to reproduce it?

borkdude15:09:56

or just an expression or so

frankitox15:09:15

Oh wait, I asked the question in the context of Conjure, sorry facepalm

frankitox15:09:24

Running something like

bb -e "(clojure.pprint/pprint {:awfawfoamwf 1 :awfoiamwfoaimw 12399401324 :apwfomafwoimawf 1234912348})"
works flawlessly 😄

nate15:09:52

Pretty printing doesn't work in an nrepl connection. I think there was an issue about it.

1
borkdude15:09:45

I think it should work now, but you might have to upgrade your bb

frankitox15:09:43

bb is at latest I think

~ bb --version
babashka v0.9.161

borkdude15:09:29

ah right, it works for cider, but not for conjure perhaps

frankitox15:09:07

I'll try compiling bb adding conjure.internal/pprint to that list

👍 1
borkdude15:09:57

you can run with the jvm to iterate a little faster

borkdude15:09:13

clojure -M:babashka/dev

🧙 1
nate15:09:40

oh cool. that's a good idea.

nate16:09:38

ah, nuts, looks like I can't use babashka in my global aliases like this:

:bbjava {:deps {io.github.babashka/babashka {:git/sha "c77944fad7acd4383ff732ebfa18412cf49bd9b2"}}
         :main-opts ["-m" "babashka.main"] }
because tools.deps doesn't checkout submodules

nate16:09:25

if I go into ~/.gitlibs/libs/io.github.babashka/babashka/c77944fad7acd4383ff732ebfa18412cf49bd9b2 and run these, it works:

git submodule init
git submodule update

nate16:09:13

ah, it still doesn't pretty print, even when running as clojure -M:babashka/dev

frankitox16:09:54

yeah, conjure uses conjure.internal/pprint as a param to the print middleware, is a function with arity 3

frankitox16:09:16

but clojure.pprint/pprint is a 2 arity function, I don't know if that affects something

nate16:09:36

oh interesting

nate17:09:43

Found a nice way to run clojure with babashka deps for dev. In an empty directory:

bb print-deps > deps.edn
neil add nrepl
clojure -M:nrepl
And then open a new script file in there and conjure connect, you'll have the nice pretty print.

nate17:09:06

hadn't tried out neil before this, it's neat

👍 1