This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-10-07
Channels
- # beginners (153)
- # cider (2)
- # cljs-dev (1)
- # cljsjs (11)
- # cljsrn (4)
- # clojure (21)
- # clojure-austin (2)
- # clojure-greece (1)
- # clojure-italy (8)
- # clojure-russia (12)
- # clojure-spec (68)
- # clojurescript (35)
- # cursive (4)
- # datomic (2)
- # fulcro (15)
- # off-topic (1)
- # om (1)
- # portkey (35)
- # protorepl (6)
- # re-frame (28)
- # shadow-cljs (13)
- # specter (10)
- # uncomplicate (3)
- # unrepl (7)
ha, I love when I find holes in my understanding of how the code works. my new obsession is INDEXED-VALS
on its own as a select it totally makes sense, but change it to a transform and compose it with another navigator and you blow my cognitive budget. I thought this code was going to return the collection unchanged (setval [INDEXED-VALS FIRST] 0 [1 2 3])
but to achieve that result you have to pass it length - 1 instead of 0
So, i’m sure this has come up before. But i can’t find any discussion on it. Possible because its a nonsense idea. But isn’t HTML a deeply nested structure? Couldn’t Specter be used to manipulate it? Actual, come to think of it, is there any overlap in concept to something like jquery?
Also is there a way to just navigate to something based not on the path but based off some predicate? like any map with the key :foo
um, yea. its called walker
I just realized that (setval [INDEXED-VALS FIRST] 0 [1 2 3])
actually reverses the collection
well anyway, I'm going to put it in as a koan so it will be interesting to see how many people come to the channel to ask about this one ha
@james Great screencast! I'll add it as a link to the readme
@drewverlee yea, Specter is perfect for manipulating HTML
it would be easy to make compound navigators to re-create the various query capabilities of jquery
@nathanmarz Thanks!