Join Arthur Ulfeldt for an in-depth discussion in this video Clojure Functions, part of Up and Running with Clojure.
- View Offline
- [Narrator] Functions are probably the single…most important construct in Clojure.…I mean, it's called a functional language for a reason.…When I use this word throughout the course,…I'm really talking about functions like you learned…in math class.…They are a function from one value to another value.…That's why we call Clojure a functional language.…Code that changes things outside of its scope,…when it's run, is said to have side effects.…So, a function like add 42 to three is a function.…It takes in one value, returns another value.…
A function that says add 42 to three…and print the word, hello, to the screen…is said to have a side effect…where you printed something to the screen…when the function was running.…So, if you run the function several times,…you'd get several printings.…They would sort of pile on top of each other.…They would have effects.…Now, a program that was purely side effect free…would not really do anything useful…other than maybe raise the ambient temperature of the room.…One effect of this striving for pure functions in Clojure…
Arthur Ulfeldt covers the Leiningen build tool and setting up Clojure to work with the IntelliJ IDEA dev environment. He then reviews the basics of the syntax, including functions, expressions, values, macros, strings, and conditionals. He shows how to structure, compile, and deploy Clojure projects in Leiningen, and pull from Clojure's core library. In the final chapters, Arthur explores references and namespaces and points to resources to learn more about Clojure.
- Installing Leiningen
- Configuring IntelliJ IDEA
- Using REPLs to execute code
- Working with simple and composite values
- Mastering Clojure macros
- Exploring Clojure syntax
- Building a Clojure project with Leiningen
- Mapping, filtering, and reducing
- Binding and destructuring data
- Working with identities