Fun with Functional Programming in Clojure
summary
Live coding uses the REPL to show concrete results: a pure map increments [1 2 3 4 5] while an impure example reading a global yields the unexpected 6 5 4 3 2 1. Persistent vectors start as 0..4, conj returns new vectors with 5 and 6 while the original stays 0..4. Mutable examples use an atom so join game adds Rachel then Harriet and rejects a third player, and a software transactional memory ref keeps a game account at 1000, gives each new player 100 and leaves the game pot at 900. A 10 million sum uses recur to avoid stack overflow. ClojureScript compiles to JavaScript and the Flappy Birds edit (collision disabled) runs live in the browser.
AI-written summary · about
chapters (25)
- 0:00Intro
- 1:08The Complexity Iceberg
- 2:02Visualization
- 5:55Functional Programming
- 7:45Syntax
- 9:12Persistent Data Structures
- 10:18Closure
- 13:30Threading
- 14:05Sequence
- 15:15Enclosure
- 15:44Lazy Evaluation
- 16:25Types
- 17:36Immutability
- 19:27Local Assignment
- 21:25Using Functions
- 23:57Polymorphism
- 26:37Sum
- 27:03Some
- 27:27Recur
- 28:23Item
- 29:06Join Game
- 29:55Ref
- 30:57Transactional Memory
- 32:36Book Exercise
- 34:23Common Words
related talks
40mFun with Functional Programming in Clojure
01h 02mSolving Problems the Clojure Way
49mA whirlwind tour of functional programming in Clojure
36mBack to the Future: How 80s Arcade Games Taught me Clojure
01h 14mClojure Katas - Functional Programming
35mApplying the paradigms of core.async in ClojureScript
34mClojure by neophyte
45mResidential Programming without Mutable State
