This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-08-22
Channels
- # aws (12)
- # babashka (24)
- # beginners (51)
- # biff (2)
- # cherry (4)
- # cider (2)
- # clj-kondo (4)
- # cljs-dev (19)
- # clojure (70)
- # clojure-australia (4)
- # clojure-europe (39)
- # clojure-nl (4)
- # clojure-norway (6)
- # clojure-spec (9)
- # clojurescript (21)
- # component (6)
- # cursive (18)
- # data-science (9)
- # datomic (18)
- # events (2)
- # expound (4)
- # fulcro (15)
- # graalvm (2)
- # graphql (5)
- # jobs (1)
- # juxt (2)
- # leiningen (8)
- # malli (4)
- # meander (21)
- # nrepl (3)
- # observability (14)
- # off-topic (49)
- # other-languages (1)
- # pathom (13)
- # pedestal (7)
- # rdf (5)
- # re-frame (10)
- # reitit (1)
- # sql (4)
- # squint (30)
- # tools-deps (1)
- # vim (11)
I was looking into SCI code and found https://github.com/babashka/sci/blob/49817626dd2b1bb69dd10457137e5df1f1fd9445/src/sci/impl/evaluator.cljc#L339. Why are other types extended if there is already an Object there with the same extension? Code below would work the same.
#?(:clj (extend-protocol types/Eval
Object
(eval [expr _ _]
expr)
nil (eval [_ _ _] nil))
Or is there something I don't see?I see there was a TODO: remove
above the Object part
https://github.com/babashka/sci/commit/16b425597f82e7b66bb3dae6aba6b3ffff022bf8
is there a trivial way in babashka to read all *in*
to bytes? (meaning read until eof)
ahhhh System/in
thanks
ahhhh readAllBytes was added in java 9
that explains it
I was looking at java 8's docs
#!/usr/bin/env bb
(require '[ :as io])
(import '[java.util.zip Inflater InflaterInputStream])
(with-open [input (InflaterInputStream. System/in (Inflater. true))]
(io/copy input System/out))
for inflating as part of a pipeline in the shell. in this case I'm working with SAML SSO and the request data is string->bytes->deflate->base64encode->urlencode and this handles the inflate portion of reversing thatis babashka/cli going to be included in babashka eventually?
Also, this new integration is there now: https://blog.michielborkent.nl/babashka-tasks-meets-babashka-cli.html
nice!!
I created this a while back
I imagine some kind of combination of babashka/cli with this sort of thing would be interesting. being able to install these as shell scripts on your path and execute something in a library
basically you can do cljx babashka/fs which ls
and it will pull down the latest babashka/fs and run the which
function with an argument of "ls"
I could see something like this being useful with, say, a database migration tool like ragtime, being able to run a function to create a new migration or to run existing migrations
or migratus
perhaps even have something in the package that describes valid args and commands and such and this could extract that to generate output
it's similar to clojure tools, in a way