This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-07-30
Channels
- # aleph (4)
- # beginners (24)
- # boot (15)
- # cider (4)
- # cljs-dev (37)
- # clojure (73)
- # clojure-losangeles (1)
- # clojure-serbia (1)
- # clojure-spec (27)
- # clojurescript (78)
- # core-logic (3)
- # datascript (9)
- # datomic (10)
- # events (1)
- # lein-figwheel (1)
- # lumo (2)
- # off-topic (14)
- # om (6)
- # om-next (1)
- # parinfer (18)
- # pedestal (2)
- # protorepl (4)
- # re-frame (2)
- # reagent (56)
- # specter (6)
- # unrepl (2)
Hey all, I’m a little confused about how conceptually to think about using filterer
versus just containing a predicate in my path. To take this example:
(select (filterer even?) (range 10))
[[0 2 4 6 8]]
(select [ALL even?] (range 10))
[0 2 4 6 8]
it is still unclear to me why the filterer
version would be nested versus the second example.
as far as I understand filterer navigates to the subcollection (so you could for example reverse it) while ALL pred navigates to every single number (so you could for example inc it)
@rcullito by navigating you to a sequence you can do things with filterer
that you can't do with navigators that go straight to subvalues, e.g. selecting the last even number in a sequence: (select-any [(filterer even?) LAST] (range 10)) ; => 8
Thanks for the examples: @drowsy, @nathanmarz! Starting to pick up on the subtleties for when it is preferable to use filterer
. Much appreciated.