This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-06-08
Channels
- # announcements (7)
- # babashka (44)
- # beginners (162)
- # cider (22)
- # clara (11)
- # clj-kondo (14)
- # cljsrn (8)
- # clojure (91)
- # clojure-dev (24)
- # clojure-europe (6)
- # clojure-france (4)
- # clojure-italy (11)
- # clojure-nl (4)
- # clojure-spec (11)
- # clojure-uk (14)
- # clojurescript (92)
- # community-development (1)
- # core-logic (1)
- # cryogen (1)
- # cursive (6)
- # data-science (3)
- # datahike (3)
- # datomic (32)
- # degree9 (3)
- # dirac (3)
- # emacs (9)
- # eql (1)
- # events (1)
- # find-my-lib (1)
- # fulcro (67)
- # graphql (13)
- # helix (9)
- # jobs (1)
- # jobs-discuss (92)
- # leiningen (31)
- # malli (8)
- # meander (3)
- # news-and-articles (1)
- # off-topic (46)
- # pathom (2)
- # practicalli (1)
- # re-frame (52)
- # reitit (12)
- # shadow-cljs (40)
- # spacemacs (10)
- # sql (4)
- # xtdb (8)
Over the weekend I made some progress with defprotocol
et. al. If you want you can test it using the babashka defprotocol
branch or grab a binary from https://clojurians.slack.com/archives/CSDUA8S6B/p1591567157005700. It also includes compatibility with defrecord
.

Thanks @borkdude!
which web-server works with babashka? only this https://github.com/bherrmann7/bb-common/blob/master/wee_httpd.bb ?
@d.ian.b bb doesn't have a built-in webserver, but you can roll your own using that code yes. what's your use case for wanting a webserver in bb?
no worries, It's just for a test
but thanks @borkdude 😃
is anyone using babashka in aws lambda aware of this issue? https://github.com/borkdude/babashka/pull/462
perhaps @U06QSF3BK?
hmm, used this layer, don't actually know what version of babashka is uses: https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:209523798522:applications~babashka-runtime
I’m using babashka.curl
to post some JSON from a string, something like this {:body "{\"foo\": \"bar\"}"
but by the time it hits the server those inner, escaped quotes have been removed, so the server sees {foo: bar}
, which of course is invalid. Is there a some way to fix this?
you could try some debugging here: https://github.com/borkdude/babashka.curl it runs as a JVM lib as well
I do this often,
(def login-body "{ \"password\": \"shesh\", \"username\": \"bob\"}" )
(def headers {"Content-Type" "application/json"})
(curl/post req-url { :headers headers :body login-body })]
also, you can try (post "foo" {:body ... :debug true})
which will also return the :command
which was used to invoke curl
:debug
shows the quotes are still escaped on the command-line. Maybe it’s a Windows Powershell thing (I’m normally a Mac guy)
well, it doesn't go through powershell, but there might be an issue with ProcessBuilder on Windows...
@jkrasnay this line: https://github.com/borkdude/clj-kondo/blob/daf3e794f60b5e8be60f36be6fb7209055096027/test/clj_kondo/test_utils.clj#L110
there is some info here: https://bugs.openjdk.java.net/browse/JDK-8131908#:~:text=Using%20ProcessBuilder%20to%20invoke%20a,%22ab%22%20by%20the%20process.
and that links to: https://docs.microsoft.com/en-us/cpp/cpp/main-function-command-line-args?redirectedfrom=MSDN&view=vs-2019
That Microsoft doc says “A double quotation mark preceded by a backslash (\“) is interpreted as a literal double quotation mark character (“).“, so I’m not sure I agree with the guy who closed the JDK bug.
@jkrasnay the alternative might be to not use quotes around the string in windows, surprisingly: https://blog.krecan.net/2008/02/09/processbuilder-and-quotes/
I think my escapes were just escaping the quotes from the Clojure reader, so I’m not sure how to leave them out.
@jkrasnay the current tests all pass on Windows: https://ci.appveyor.com/project/borkdude/babashka-curl/builds/33395135 now add a failing test...
@jkrasnay this version should now work as expected: https://ci.appveyor.com/api/buildjobs/94oyb3vwo7f00i7u/artifacts/babashka-0.1.1-SNAPSHOT-windows-amd64.zip