Introducing X5 and JC

Introducing X5 and JC

We introduce X5, who wants to be a baker. He's going to baking school. JC is his baking instructor. We'll be helping X5 learn, by using Clojure.

Introducing X5 and JC

X5 is a robot who has always wanted to learn how to bake. He is going to baking school and we're going to teach him how to bake cakes and cookies, how to manage a day's orders, and how to store recipes throughout this course.


JC is his baking instructor at the school. She'll be giving him assignments to learn to bake.


In this first day at baking school, X5 will learn to use ingredients to bake cakes and cookies. He comes built-in with basic movement commands like grab, squeeze, and mix. We'll be taking those built-in commands and making new ones that are more oriented around baking.

B01 Introduction to Clojure (old version)

Buy nowLearn more
  • Introduction9

Day 1

  • Introducing X5 and JC
  • Working with the REPL3
  • Defining functions
  • Defining a bake-cake function
  • Conditionals10
  • Defining scooped?
  • Defining squeezed?
  • Defining simple?2
  • Defining ingredient types2
  • Looping a number of times6
  • Using the plural functions2
  • Variadic functions8
  • Baking with variadic functions4
  • Bake cookies function
  • Day 1 Conclusion2

Day 2

  • Running Leiningen projects16
  • Error function10
  • Refactoring errors
  • Bakery locations
  • Scooped?, squeezed?, and simple? refactor2
  • Fetching ingredients4
  • Fetch ingredients generic
  • Maps
  • Fetching a shopping list
  • Refactoring fetch-list1
  • Refactoring locations2
  • A day at the bakery5
  • Analyzing a day at the bakery
  • Functional programming2
  • Into2
  • multiply-ingredients2
  • order to ingredients
  • orders to ingredients
  • Making one shopping trip
  • Making one delivery
  • Day 2 conclusion

Day 3

  • Day 3
  • Add cocoa
  • Baking brownies
  • Analyzing recipes1
  • Starting the database
  • Perform
  • Mix step
  • Pouring and baking
  • Adding ingredients2
  • Bake recipe
  • Generic bake function
  • Adding all recipes1
  • Cleaning up order to ingredients
  • Ingredients in the database
  • Refactoring scooped, squeezed, and simple2
  • Generic fetch ingredient
  • Refactoring fetch-list (again)1
  • Make storage-location more useful
  • Redefining add
  • Defining actions
  • Refactoring perform1
  • Conclusions1

Appendices

  • Appendix: Creating a Leiningen project