This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-04-30
Channels
- # babashka (46)
- # beginners (234)
- # bristol-clojurians (4)
- # cider (7)
- # clj-kondo (39)
- # cljdoc (8)
- # cljs-dev (10)
- # cljsjs (10)
- # cljsrn (24)
- # clojure (84)
- # clojure-brasil (7)
- # clojure-europe (12)
- # clojure-germany (4)
- # clojure-italy (3)
- # clojure-nl (41)
- # clojure-spec (17)
- # clojure-uk (66)
- # clojurescript (64)
- # conjure (161)
- # cursive (12)
- # data-science (45)
- # datomic (20)
- # devops (11)
- # docker (2)
- # duct (9)
- # events (7)
- # figwheel (1)
- # figwheel-main (20)
- # fulcro (32)
- # graalvm (5)
- # helix (82)
- # jackdaw (9)
- # jobs-discuss (19)
- # kaocha (11)
- # local-first-clojure (1)
- # malli (6)
- # meander (3)
- # nrepl (12)
- # off-topic (2)
- # other-lisps (15)
- # pathom (14)
- # rdf (6)
- # re-frame (8)
- # reactive (1)
- # reagent (5)
- # reitit (4)
- # rum (3)
- # shadow-cljs (77)
- # spacemacs (3)
- # sql (9)
- # test-check (31)
- # tools-deps (13)
- # vim (62)
- # xtdb (18)
hi! I'm using clj-yaml
but this is happening:
user=> (yaml/parse-string "a: 1")
#ordered/map ([:a 1])
user=> (type *1)
flatland.ordered.map.OrderedMap
user=> (flatland.ordered.map/ordered-map :a 1)
clojure.lang.ExceptionInfo: Could not resolve symbol: flatland.ordered.map/ordered-map [at line 15, column 2]
it does work in clj
with clj-yaml
in deps.edn
@clojurians884 makes sense because flatland ordered is not exposed. Why do you need that API? Can you give an example program where it would be useful? You can do (into {} the-ordered-map)
btw
yeah, it seems like using Clojure's maps is enough for what I need. thanks!
Evaluation criteria for adding libraries and classes to babashka: https://github.com/borkdude/babashka/blob/master/doc/dev.md#adding-libraries-and-classes. What do you think?
Was looking through the source this morning and came across this: https://github.com/borkdude/babashka/blob/master/src/babashka/impl/features.clj
Probably never, because that assumes you already have a bb which is not realistic for someone who wants to build from source. And thanks.
Oh yeah, good point about not having bb. Totally forgot that some people might not have it yet.
yeah, also in build environments, you can't really expect bb to be there, and then you would have to depend on Github releases to get one, etc., it's not that great to rely on too many things
yeah they feel good to me. i think this is a good middle-ground for everyone
I was having doubts about core.async maybe, but I also don't want to break existing scripts.
i'll resurrect my psql parsing code and make a small lib for those that don't want to build their own exe
i'll be doing that definitely
I think core async adds a nice bit around threads. I haven't used it in bb yet, just did a bunch of future calls.
yeah keeping async in makes sense to me. in bash you have &
for background jobs, same in babashka with core.async
Feature flags: https://github.com/borkdude/babashka/blob/master/doc/build.md#feature-flags
random thought on feature flags, how about including what features are compiled in when showing babashka's version?
would it maybe be better to have a --describe
option that outputs a chunk of EDN with the version and all the features, and possible other stuff as well, so it's also parseable by other Clojure programs?
$ ./bb --describe
{:babashka/version "0.0.90-SNAPSHOT"
:feature/core-async true
:feature/csv true
:feature/java-nio true
:feature/java-time true
:feature/xml true
:feature/yaml true
:feature/jdbc false
:feature/postgresql false
:feature/hsqldb false}
I’m trying to run (clojure.java.shell/sh "keytool" ,,,)
but it’s not waiting for me to type into stdin for a password - any tips?
@lilactown Maybe you can use the :in
option?
$ bb '(shell/sh "cat" :in "foo")'
{:exit 0, :out "foo", :err ""}
or do you really want to type something interactively?if clojure.java.shell
doesn't work, you might also be able to use ProcessBuilder
: https://github.com/borkdude/babashka/issues/299
@lilactown Interactive program:
$ bb '
(let [program ["bash" "-c"
"echo \"type something!\"; read input; echo \"you typed: $input\""]
pb (doto (ProcessBuilder. program)
(.inheritIO))
p (.start pb)]
(.waitFor p) nil)'
type something!
1
you typed: 1