This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-01-07
Channels
- # aws (2)
- # bangalore-clj (4)
- # beginners (62)
- # boot (74)
- # cider (408)
- # cljsrn (17)
- # clojure (117)
- # clojure-dusseldorf (1)
- # clojure-russia (21)
- # clojure-spec (17)
- # clojure-uk (15)
- # clojurescript (154)
- # cursive (3)
- # datomic (16)
- # emacs (33)
- # funcool (3)
- # hoplon (99)
- # off-topic (7)
- # om (10)
- # overtone (3)
- # portland-or (1)
- # protorepl (9)
- # re-frame (83)
- # reagent (11)
- # remote-jobs (1)
- # ring-swagger (24)
- # specter (10)
- # untangled (1)
- # yada (11)
I’m confused with the result of (sp/walker sequential?)
(sm/select (sp/walker sequential?) {:b [1 2 nil 3]}) => [[:b [1 2 nil 3]]]
I would have expected [1 2 nil 3]
@wei looks like clojure.walk navigates to the key/value pairs of maps, which it considers sequences
for removing nils, use com.rpl.specter.zipper
or navigate to the sequence and use filter
if https://github.com/nathanmarz/specter/issues/117 is implemented will be able to do (setval [ALL nil?] NONE data)
@nathanmarz thanks for the tips. can zipper remove all nils an a nested structure? having some trouble putting it together
@wei like this: (setval [z/VECTOR-ZIP z/DOWN z/RIGHT z/NODE-SEQ] [] [1 2 3 4])
@wei removing nils: (setval [z/VECTOR-ZIP z/DOWN z/NEXT-WALK (selected? z/NODE nil?) z/NODE-SEQ] [] [1 2 nil 3 nil])
obviously the approach in #117 would be more elegant as well as more performant