This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-03-16
Channels
- # aws-lambda (3)
- # beginners (20)
- # boot (201)
- # cljs-dev (45)
- # cljsrn (9)
- # clojars (19)
- # clojure (141)
- # clojure-china (2)
- # clojure-dev (11)
- # clojure-greece (6)
- # clojure-italy (1)
- # clojure-new-zealand (1)
- # clojure-romania (1)
- # clojure-russia (55)
- # clojure-spec (58)
- # clojure-taiwan (1)
- # clojure-uk (97)
- # clojure-ukraine (40)
- # clojurescript (77)
- # core-async (5)
- # core-typed (1)
- # cursive (35)
- # datomic (9)
- # jobs (2)
- # jobs-rus (25)
- # juxt (8)
- # lein-figwheel (14)
- # luminus (24)
- # mount (16)
- # off-topic (56)
- # om (36)
- # onyx (22)
- # pedestal (3)
- # perun (14)
- # re-frame (111)
- # reagent (5)
- # remote-jobs (6)
- # ring-swagger (3)
- # slack-help (1)
- # specter (17)
- # unrepl (12)
- # untangled (56)
Hey, looking for a way to dissoc all items that are not matched by a select
@narkisr Like this? (sp/setval [sp/ALL (sp/not-selected? sp/LAST odd?)] sp/NONE {:a 0 :b 1})
I think so but my path is based on srange (I want to remove all items except last n)
Ill give it a go and report back
@rauh you can do that more concisely and efficiently with: (setval [MAP-VALS even?] NONE {:a 0 :b 1})
@narkisr you can do that by transforming the srange to be a smaller sequence only containing the last n elements
e.g. (transform (srange 1 5) #(subvec % 2 4) [1 2 3 4 5 6 7 8]) => [1 4 5 6 7 8]
Hey Natan, (transform [MAP-VALS (srange 1 4)] NONE (into (sorted-map) {1 2 3 4 5 6 7 8 9 10})))
Seems to not keep the sorting order
([1 2] [9 10])
Never mind
Just realized iv should have used (srange 0 3)
Also not sure how many you get feedback but specter is awesome, I can't imagine writing Clojure without it
So big thank you
@narkisr thanks, glad to hear it