Fork me on GitHub

Good morning, I sometimes have this problem with my nrepl session where I execute a form and then it doesn't return. In this case it's (-> @(p/process ["git" "log" "--numstat" "--pretty=format:'[%h] %an %ad %s'" "--date=short"]) :out slurp), where p is babashka.process.


@gerome.bochmann Does that process have long output as in, pages long?


Yes, it's a long output


In this case it's better to use :out :string since the way you're doing it now it fills a buffer which is never consumed before the process ends and then the process is waiting.


(-> @(p/process ... {:out :string}) :out)


Ha! That helped! Thanks @borkdude

👍 1

Hi folks. I’m trying to use (binding [*default-data-reader-fn* tagged-literal] ...) , but I’m getting this error:

70: (binding [*default-data-reader-fn* tagged-literal]
              ^--- Could not resolve symbol: *default-data-reader-fn*
What would be the expected way of using tagged-literal for unknown tags?


Also tried to require [], seems that it’s not available


@andre.peric this is added in the newest bb: 0.6.8. are you using that?


I’m using v0.6.5. Will update, thanks 🚀


I’m getting this error. I though it was supposed to handle all unknown tags:

74: (binding [*default-data-reader-fn* tagged-literal]
75:   (main 1))
      ^--- No reader function for tag my/redacted-tag
I’m reading a file with edn/read-string in main. Maybe my expectations are wrong :thinking_face:


yeah, default-data-reader-fn only works for clojure.core/read. edn/read-string supports an options map:


([] [stream] [opts stream])
  Reads the next object from stream, which must be an instance of or some derivee.  stream defaults to the
  current value of *in*.

  Reads data in the edn format (subset of Clojure data):

  opts is a map that can include the following keys:
  :eof - value to return on end-of-file. When not supplied, eof throws an exception.
  :readers  - a map of tag symbols to data-reader functions to be considered before default-data-readers.
              When not supplied, only the default-data-readers will be used.
  :default - A function of two args, that will, if present and no reader is found for a tag,
             be called with the tag and the value.


so you need to use (clojure.edn/read-string {:default (fn [tag value] ...)} ...)


Oh. Makes sense. Thanks a lot, @borkdude


Added a bunch of libs to CI for testing the new spec compatibility: • better-cond • coax (exoscale) • orchestra (also tests expound indirectly) • integrant • tested guardrails manually, but tests are hard to extract, they are intertwined with loading ClojureScript

👏 2
Mandimby Raveloarinjaka23:12:03

Does net.cgrand/xforms work with babashka? I thought I read that somewhere but I cannot see it in the list of projects ( and when I try to add it I get an error ; eval (current-form): (require '[net.cgrand.xforms :as x]) ; (err) : Unable to resolve classname: java.util.Comparator


Which version are you using? I have an open PR at xforms which should make it compatible with bb 068. Please leave some feedback at the PR to encourage the maintainer to merge it

Mandimby Raveloarinjaka16:12:33

I am using 0.6.1. Thanks for the answer I will check the PR.


I recommend using 0.7.0 and you can use my original fork meanwhile