This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-04-19
Channels
- # announcements (24)
- # asami (25)
- # babashka (17)
- # beginners (99)
- # bitcoin (1)
- # calva (2)
- # cider (6)
- # cljs-dev (4)
- # clojure (88)
- # clojure-australia (3)
- # clojure-europe (23)
- # clojure-france (6)
- # clojure-nl (5)
- # clojure-uk (31)
- # clojured (1)
- # clojurescript (6)
- # clojureverse-ops (1)
- # datomic (28)
- # depstar (18)
- # emacs (11)
- # events (1)
- # fulcro (21)
- # graalvm (4)
- # graphql (7)
- # heroku (1)
- # jackdaw (18)
- # joker (3)
- # kaocha (1)
- # lsp (1)
- # malli (13)
- # meander (4)
- # off-topic (12)
- # pathom (14)
- # pedestal (2)
- # podcasts-discuss (1)
- # re-frame (37)
- # reagent (17)
- # reitit (9)
- # shadow-cljs (44)
- # xtdb (17)
morning
mån¡
I was a bit surprised to learn that destructuring a map, that has a nil, using either when-some
or when-let
doesn't do what I thought it might do
(def config {:foo {:bar nil}})
(when-some [{{:keys [bar]} :foo} config]
(format "This is %s" bar)) ;; "This is null"
the test is the whole bound value @dharrigan, not something destructured out of it - and config
is not nil
so is there a better way of writing this so that if "bar" is nil, then not to execute the body?
that's what i would do
Have people seen this by any chance? https://github.com/IGJoshua/farolero
I've not used CL style exceptions much, but they seem handy, I'm assuming they handle normal js / java exceptions as well, would be cool to see some more interesting things happening here 😃...
My current understanding, and I believe something the blog author also comments upon, is that because (at least on the JVM) Clojure, being a hosted language, the normal paradigms of try, catch
and if-some
(and the ilk) are very common, then it may feel a bit unnatural
I'm not sure tbh, I will definitely need to spend some more time experimenting and learning to see if it works for me 😉
Thanks 😃... I mean I'm hoping it will allow for more flexibility in dealing with exceptions...
Yes, agreed. I am eager to delve further into it and see if can help my applications 🙂
If I recall, someone here got the "Software Design for Flexibility" book by Chris Hanson and Gerald Jay Sussman
It’s good. I’ve only read the first two or three chapters so far. I’m not sure for many people the name reflects the contents. It’s more of a fugue on compositional systems. Obviously composition is a way to build flexible software, but in places it is a bit detached from practical applications typical developers face. That’s not to say that it’s not practical, just that things like the combinator system in chapter 1 aren’t really presented as a solution to a real world problem. It’s not really contrasted to the alternative, and iirc there’s no final program built from the combinators they make which was a little disappointing. Being a long time fan of Sussman though the contents are exactly what I was expecting, and why I bought it, so no real complaints from me.