This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-07-07
Channels
- # bangalore-clj (3)
- # beginners (103)
- # boot (13)
- # cider (16)
- # cljs-dev (192)
- # cljsrn (44)
- # clojure (147)
- # clojure-dev (1)
- # clojure-italy (79)
- # clojure-norway (1)
- # clojure-russia (9)
- # clojure-spec (4)
- # clojure-uk (34)
- # clojurescript (65)
- # core-async (1)
- # core-logic (2)
- # core-typed (5)
- # cursive (1)
- # datascript (9)
- # datomic (26)
- # emacs (8)
- # garden (1)
- # hoplon (11)
- # humor (1)
- # jobs (1)
- # jobs-discuss (8)
- # jobs-rus (3)
- # leiningen (1)
- # luminus (1)
- # lumo (1)
- # mount (6)
- # off-topic (16)
- # om (10)
- # om-next (1)
- # onyx (10)
- # parinfer (10)
- # pedestal (25)
- # re-frame (27)
- # reagent (3)
- # rum (47)
- # uncomplicate (1)
- # unrepl (34)
- # untangled (120)
- # vim (58)
☀️ Morning
🙃 umown 🙂
does anyone have a clever trick for using or
within ->>
?
got a concrete example? i think in practice i’ve usually come up with a named function to represent that step
i sometimes stick a (#(or % :foo))
step in. feels a bit dirty tho
In the end I have changed my ->>
for a ->
and turned my (re-find #"re")
step into a (->> (re-find #"re"))
I did consider a custom or
-like macro that reversed its arguments first, but it didn’t seem worth it.
and there is always as->
@peterwestmacott
yes, but with as->
I cannot use bare keywords or functions
eg. (as-> {:foo 1} x :foo inc)
it would also be nice if regexes acted as functions
or maybe if re-find
handled nils gracefully
what’s the clojure way of comparing lists/seqs when you don’t care about the order of the items?
Thought there might be a nicer way to do the comparison. Don’t really want to pull in midje
just for this https://github.com/marick/Midje/wiki/Checkers-for-collections-and-strings