Sveriges mest populära poddar

Functional Design in Clojure

Episode 002: Tic-Tac-Toe, State in a Row

20 min • 9 november 2018

Christoph tries to make tic-tac-toe and gets stuck on immutability.

  • The REPL calculator
  • Let's make a game!
  • How do you keep track of the game board?
  • How do you update the game board if you can't change anything?
  • OO told me the "right" way to encapsulate, now what do I do?
  • "Nine lines of let block, and one line of actual function."
  • "The reference bucket brigade"
  • reductions wants to blow your mind
  • Multiple universes of tic-tac-toe, and they're all in a row!
  • Time travel, for free!

Clojure in this episode:

  • assoc
  • assoc-in
  • ->
  • reduce
  • reductions
Förekommer på
00:00 -00:00