Just finished setting up figwheel to get started with some clojurescript escapades, awesome work on the tutorial @bhauman
4
TIL: You can destructure nested maps. As an example:
(let [{:keys [a b]
{:keys [c]} :x
{:keys [] {:keys [d]} :z} :y}
{:a 1
:b 2
:x {:c :skip-a-few}
:y {:z {:d Integer/MAX_VALUE}}}]
[a b c d])
=> [1 2 :skip-a-few 2147483647]
4
TIL: Threading a map through a bunch of updates is way cleaner than updating it in the let bindings over and over.
I'm just gonna (let [myself (update-in my-brain [:thinking-area] conj "a lot of IQ")]
myself)
And now I realize how much of a bruh moment this is.
TIL: update-in > assoc-in. If you don't agree name the place, time and game so we can 1v1 as long as I'm better at the game than you.
TIL: Range includes the first given number, but leaves out the last. I guess it's true that something can be both ranged and deranged at the same time.
8
You might not wanna feed your maps too much. Mine started being completely random when it over 8 keys.
3
You must use the brackets, so it would be something like
(get-in {:foo 1 :bar 2} [(if (= foo 1) :foo :bar)])
1
1
