The Clojure Padawan (@ClojurePadawan) profile picture

I be out here learning clojure

Joined November 2020
Just finished setting up figwheel to get started with some clojurescript escapades, awesome work on the tutorial @bhauman
4
Defmulti isa nice bit of magic I just learned. Can't tell you my methods though.
2
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.
1
2
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.
1
3
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
Replying to @orestis @borkdude
Clojure's just cool like that 馃槑
1
Replying to @orestis @borkdude
You must use the brackets, so it would be something like (get-in {:foo 1 :bar 2} [(if (= foo 1) :foo :bar)])
1
1
TIL: You can use functions inside the get-in vector. I'd say it's a key lesson!
1
2
12
TIL: Conj adds to the start of a list, but the end of a vector. Would it kill it to be cons-istent?
2
7