University of California, Berkeley
EECS Department - Computer Science Division

CS3L OaW Lecture 8 : Higher-Order Functions (HOFs)


Review

Higher-Order Functions (chapter 8)

Introduction (and First-class data)

every : Do something to every word in a sentence

keep : Keep only the words or letters you want

accumulate : Combine the words in some way

(accumulate + '(4 3 2 1))
;; ==> (+ 4 (+ 3 (+ 2 1)))
;; ==> (+ 4 (+ 3 3))
;; ==> (+ 4 6)
;; ==> 10

Combine higher-order functions

Choosing the right tool (mini-summary)

These are NOT the holy grail of higher-order functions!
These are just three of the ones we have in the book. We showed how to write new ones:

repeated : A function that returns a function!


Summary

In Lab this week you'll see...

In Life this week you'll see...