This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-10-01
Channels
- # 100-days-of-code (2)
- # announcements (3)
- # beginners (95)
- # bitcoin (1)
- # cider (18)
- # cljdoc (9)
- # cljs-dev (8)
- # clojure (55)
- # clojure-austin (1)
- # clojure-berlin (4)
- # clojure-italy (21)
- # clojure-nl (1)
- # clojure-russia (2)
- # clojure-spec (47)
- # clojure-uk (31)
- # clojurescript (19)
- # component (8)
- # cursive (5)
- # data-science (2)
- # datomic (33)
- # emacs (7)
- # events (1)
- # figwheel (8)
- # fulcro (16)
- # graphql (27)
- # hyperfiddle (5)
- # jobs (1)
- # jobs-discuss (85)
- # keechma (7)
- # luminus (11)
- # mount (6)
- # off-topic (23)
- # onyx (1)
- # re-frame (4)
- # shadow-cljs (29)
- # specter (19)
- # tools-deps (11)
- # uncomplicate (3)
I have two selects that only differ in the argument to must
: (select [ALL ALL (selected? (must x))] board)
, where x
is :color
and :robot
if you want to do 1 call that returns both, you could probably do (selected? (multi-path (must :color) (must :robot)))
?
probably could also do (must (multi-path :color :robot))
?
oh sorry, I forgot to mention that I would like to get the results in two different arrays, sort of like this:
user=> (select [(multi-path (filterer odd?) (filterer even?))] (range 10))
[[1 3 5 7 9] [0 2 4 6 8]]
I have a vague recollection that I’ve asked this question before, and that the answer was no 😄
besides doing (multi-path (subselect ...) (subselect ...))
, but that's no more efficient than just doing two select
's
hmm. can anyone think of a way to say "every element after the first element" without knowing the length of the sequence in advance? like a rest
or drop 1
navigator?
@idiomancy you can do that with srange-dynamic
or INDEXED-VALS
actually (def REST (path (srange-dynamic #(do 1) count) ALL))
is better
more efficient to use when constructing paths dynamically