This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-01-05
Channels
- # beginners (29)
- # boot (29)
- # cider (54)
- # cljs-dev (99)
- # cljsjs (31)
- # cljsrn (39)
- # clojars (32)
- # clojure (171)
- # clojure-austin (2)
- # clojure-berlin (5)
- # clojure-brasil (3)
- # clojure-greece (2)
- # clojure-italy (1)
- # clojure-korea (11)
- # clojure-spec (202)
- # clojure-uk (166)
- # clojurescript (130)
- # cursive (54)
- # datomic (99)
- # dirac (18)
- # figwheel (6)
- # hoplon (23)
- # lambdaisland (3)
- # leiningen (8)
- # luminus (14)
- # off-topic (11)
- # om (3)
- # om-next (24)
- # onyx (59)
- # planck (25)
- # protorepl (10)
- # re-frame (49)
- # reagent (14)
- # ring-swagger (2)
- # rum (46)
- # schema (1)
- # slack-help (6)
- # specter (7)
- # testing (7)
- # untangled (115)
- # yada (1)
I’ve tried various combinations of map-indexed
but then I’m back to the ‘reconstruct the right type’ problem
if I had a version of collected?
that also gave you the current element, I guess something like this would work:
(sr/transform [(sr/collect sr/ALL) sr/ALL (sr/collected-with-current? [collected current] (= 0 (mod (.indexOf collected current) n)))] f (range 10))
@schmee you would either need zippers for that or a custom navigator
zippers are integrated with specter in com.rpl.specter.zipper
something like ALL-INDEXED
which navigates to pair of [index value]
should do the trick