O'Reilly logo

Learn You Some Erlang for Great Good! by Fred Hebert

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 5. Hello Recursion!

Some readers accustomed to imperative and object-oriented programming languages might be wondering why we haven’t covered loops already. The answer to this is a question: What is a loop? The truth is that functional programming languages usually do not offer looping constructs like for and while. Instead, functional programmers rely on a silly concept called recursion, which is the topic of this chapter.

image with no caption

How Recursion Works

Recall how invariable variables were explained in Chapter 1 (if you can’t, reread Invariable Variables in Invariable Variables). Recursion can also be explained with the help of mathematical concepts ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required