This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-05-29
Channels
- # announcements (15)
- # babashka (17)
- # beginners (66)
- # calva (18)
- # clojure (20)
- # clojure-dev (2)
- # clojure-europe (27)
- # clojure-nl (1)
- # clojure-norway (24)
- # clojure-sweden (5)
- # clojure-uk (4)
- # clr (1)
- # cursive (3)
- # datomic (10)
- # dev-tooling (9)
- # gratitude (1)
- # honeysql (5)
- # hyperfiddle (13)
- # malli (4)
- # music (1)
- # nrepl (1)
- # off-topic (31)
- # polylith (11)
- # portal (6)
- # re-frame (3)
- # reitit (4)
- # releases (1)
- # shadow-cljs (8)
- # squint (4)
- # tools-build (26)
- # vim (1)
- # yamlscript (52)
Note that this is only in the default user
namespace, not when you create your own namespaces :)
That makes sense!
Now we're on the topic, would it make sense to have the -i
flag being default, when -e
is used?
I don't plan on adding any more bells and whistles regarding those flags, but what would be your use case?
I just went for bb
for splitting some string by :
in a pipe, and everything was just plain obvious, except maybe for that flag.
Honestly, it didn't take much to do bb --help
, but still 😄 My casual usages of bb
in pipes would be less verbose if it was just bb -e
all over the place
you mean like this?
$ echo 'foo:bar' | bb '(str/split (slurp *in*) #":")'
["foo" "bar\n"]
Oh, I thought I needed the -e
- and I hadn't considered (slurp *in*)
- I don't need input to be a lazy seq
Those -i -I etc flags are convenient, but I consider them mostly a left-over from early experiments when bb didn't support as much of Clojure as it does now :)
When does -e
make sense? In the docs it says
> -e, --eval <expr> Evaluate an expression.
But that's exactly what's happening in your snippet as well?
yeah, -e
is good to use, just forgot it in the last snippet I wrote. bb does work without it
What would be a good routing library for babashka? or should i go the plain route with httpkit?
you could use https://github.com/askonomm/ruuter or just dispatch on uri yourself
great also found ruuter but thought there would be more opinions about something better. But i allready liked ruuters idea reminds me a bit of hapi in the node world which i liked a lot. So nothing more fancy than that. Than i'll go that rout thank you once again @U04V15CAJ