• Skip to main content
  • Skip to footer

PurelyFunctional.tv

  • Learn Clojure
  • About
  • 🛒 Cart
  • Log in
Download
 Video time: 05m40s
 
NEXT

Want this course?

Buy for $75

length

Course: Recursion 101

Updated October 25, 2019

Description
Notes

In the first lesson in Recursion 101, we jump right into defining a function that we use all the time but might not think of as recursive: length, which calculates the length of a list. This lesson includes a video screencast and some code. The lesson is 6 minutes long.

In the first lesson in _Recursion 101, _we jump right into defining a function that we use all the time but might not think of as recursive: length, which calculates the length of a list.

(defn length [ls]
  (if (empty? ls)
    0
    (+ 1 (length (rest ls)))))

Next Lesson

4 min

map

In the second lesson in Recursion 101, we define another recursive function, map. This lesson includes a video screencast and some code. This lesson includes a video screencast and some code.

Course: Recursion 101

0 / 10
0 / 10
 
Lessons
 
length
free  
6 min 
 
map
 
4 min 
 
filter
 
3 min 
 
The Two Types of Recursion
 
5 min 
 
filter with tail recursion
 
8 min 
 
map with tail recursion
 
3 min 
 
length with tail recursion
 
3 min 
 
How is Recursion like a for loop?
 
5 min 
 
Recursion and laziness
 
3 min 
 
loop/recur
 
5 min 

Footer CTA

Level up your Clojure skills

The PurelyFunctional.tv Newsletter is a weekly email that helps you improve your Clojure skills through challenges, tips, and news.

Enter your email address to receive emails about Clojure and Functional Programming. These include the weekly newsletter and occasional offers. You can unsubscribe any time.

Copyright © 2021 LispCast and Eric Normand