This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-09-30
Channels
- # announcements (8)
- # babashka (73)
- # beginners (126)
- # calva (8)
- # cider (5)
- # circleci (2)
- # clara (9)
- # clj-kondo (4)
- # cljdoc (18)
- # cljfx (49)
- # clojure (51)
- # clojure-australia (3)
- # clojure-europe (41)
- # clojure-france (1)
- # clojure-nl (5)
- # clojure-norway (1)
- # clojure-russia (1)
- # clojure-uk (16)
- # clojurescript (14)
- # conjure (4)
- # cursive (5)
- # data-science (7)
- # datascript (1)
- # datavis (1)
- # datomic (13)
- # defnpodcast (2)
- # emacs (4)
- # events (2)
- # figwheel-main (7)
- # graalvm (23)
- # hoplon (2)
- # jobs (1)
- # meander (15)
- # numerical-computing (1)
- # off-topic (35)
- # pedestal (5)
- # portkey (5)
- # re-frame (19)
- # reagent (9)
- # reitit (14)
- # releases (1)
- # shadow-cljs (28)
- # sql (4)
- # tools-deps (5)
- # xtdb (7)
So in some talk or another Rich says that sets are undervalued and underutilized data structures, and I see from our code that in many places where we could have used sets, we end up using lists or vectors.
But I have a feeling that that adding maps
and filters
would probably be the wrong approach and that this should rather be handled with transducers in some way? Thoughts?
Btw this one is rather nice:
user=> (disj #{"foo" "bar" "baz" nil} nil)
#{"foo" "bar" "baz"}
user=>
compared to
user=> (filter identity ["foo" "bar" "baz" nil])
("foo" "bar" "baz")
or
user=> (remove nil? ["foo" "bar" "baz" nil])
("foo" "bar" "baz")
user=>
morning
@slipset interesting. I've noticed lately that I'm only really using filter/map/etc in the context of transducers so I'm usually preserving the type of the collection by doing into or transduce with a collection type (same w/reduce)
Any reason for that instead of
(->> (get tagged-episode ::edit) (map ::command) (into #{}))
@slipset not a good one other than consistency and every time I end up having a single thing in my trasnducer pipeline the universe laughs and says "ha! you need another"
when I write them I tend to do the following:
(into #{}
my-coll)
and then put the transducing functions in the middle as I work through itmost of the things about transducers go on about the internals and are a bit light on the using, which wasn't too hard once I grokked how to go from one to another
@slipset literally comping in another xf into an into as I need to filter some things out before I do a sort. 😉
Good afternoon
What an honor!
clojure.lang.IReduceInit
?
is that cheating?
java.util.Iterator
and java.util.Iterable
are also big favourites
@dominicm I already analyzed a bunch of code: https://github.com/borkdude/analyze-reify