This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-10-01
Channels
- # beginners (2)
- # boot (1)
- # cljs-dev (126)
- # cljsrn (4)
- # clojars (1)
- # clojure (109)
- # clojure-austin (5)
- # clojure-austria (1)
- # clojure-boston (2)
- # clojure-brasil (33)
- # clojure-canada (1)
- # clojure-russia (1)
- # clojure-spec (62)
- # clojurescript (23)
- # core-async (1)
- # cursive (33)
- # datomic (26)
- # ethereum (2)
- # hoplon (7)
- # jobs (1)
- # lein-figwheel (1)
- # luminus (12)
- # off-topic (4)
- # om (3)
- # om-next (49)
- # perun (2)
- # protorepl (2)
- # specter (6)
- # test-check (1)
- # untangled (2)
- # vim (6)
- # yada (30)
It seems like pred
would also work in the last couple examples where you've recommended selected?
. What are some instances where they would behave differently?
well, for pred
to work like (selected? (must :a) (must :b))
you would have to write #(and (contains? % :a) (contains? (:a %) :b))
@puzzler selected?
is particularly good for things like (selected? (filterer even?) (view count) #(>= % 2))
, which stays navigated at current position if the sequence contains at least 2 even numbers
or something like (selected? ALL even?)
which stays navigated if at least one even number
It sounds like, basically, pred takes a Clojure predicate function and selected? takes a navigator path.
@puzzler yes, that's correct