This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-12-12
Channels
- # adventofcode (78)
- # announcements (5)
- # babashka (22)
- # beginners (230)
- # calva (18)
- # cider (26)
- # clj-kondo (1)
- # cljs-dev (1)
- # clojure (14)
- # clojure-austin (1)
- # clojure-dev (3)
- # clojure-europe (30)
- # clojure-switzerland (1)
- # clojure-uk (26)
- # clojurescript (33)
- # conjure (2)
- # cursive (2)
- # data-science (1)
- # datomic (9)
- # docker (1)
- # emacs (8)
- # events (4)
- # fulcro (64)
- # lambdaisland (3)
- # luminus (1)
- # off-topic (3)
- # pathom (6)
- # portal (1)
- # programming-beginners (5)
- # shadow-cljs (22)
- # tools-deps (8)
- # xtdb (4)
I've recently started using https://asdf-vm.com/#/ to handle my programming language versions. There wasn't a babashka plugin for it yet, so I https://github.com/fredZen/asdf-babashka. I haven't submitted a pull request to add it to the http://list%20https://asdf-vm.com/#/plugins-all, but that would be my next step.

Awesome. Feel free to PR some docs for the install instructions (please use [skip ci] in the commit message for only doc PRs)
Hello 🙂 I am referring to this issue on jet (https://github.com/borkdude/jet/issues/74) I have an issue, I don't know how to solve: how do you transform the input stream *in*
as string?
thhanks 🙂
I get an exception: stream closed.
let me check
$ bb '(keys (yaml/parse-string (slurp *in*)))' < .circleci/config.yml
(:version :jobs :workflows)
Yep, my problem was for jet, the main read from a stream and expect to do so.
So I am circumventing the problem the problem by not supporting conversion from yaml
(I know it is weak)
[reader (case from
:json (formats/json-parser)
:transit (formats/transit-reader)
:edn nil)
next-val (case from
:edn #(formats/parse-edn edn-reader-opts *in*)
:json #(formats/parse-json reader keywordize)
:transit #(formats/parse-transit reader))
collected (when collect (vec (take-while #(not= % ::formats/EOF)
(repeatedly next-val))))]
This is from the main namespace of jet. I did not manage to make work with input stream here.@neo2551 you might first want to do this PR: https://github.com/clj-commons/clj-yaml/issues/3 :)
in the namespace there is a loop somehow, and if you slurp the *in*
once, it will throw an error.
(defn clojure
"Starts clojure similar to CLI. Use `rlwrap bb` for `clj`-like invocation.
Invokes java with babashka.process/process for `-M`, `-X` and `-A`
and returns the associated record. Default options passed to
babashka.process/process are:
{:in :inherit
:out :inherit
:err :inherit
:shutdown p/destroy-tree}
which can be overriden with opts.
Returns `nil` and prints to *out* for --help, -Spath, -Sdescribe and
-Stree.
Examples:
(-> (clojure '[-M -e (+ 1 2 3)] {:out :string}) deref :out) returns
\"6\n\".
(-> @(clojure) :exit) starts a clojure REPL, waits for it
to finish and returns the exit code from the process."
...)
^ proposal for babashka.deps/clojure
, a function to launch a Clojure process from within babashka (without installing additional tools but java).