Lesson 22: Tail Recursion, continued
Outline:
- Recap: tail-call optimization
- recognizing tail recursion
- writing tail-recursive functions
- [If time] Function pointers
- syntax in C
- functions vs. special forms in Scheme
- Wrap-up
What’s next
Upcoming events/assessments:
- CS Bits and Bytes tomorrow at 3:30pm in Anderson 329: Abby Marsh on Privacy and Digital Communities
- Interpreter Parts 4+5 cannot be resubmitted after next Monday at 10pm
- Quiz 6 will be this Friday as part of Exam Day #2 and cover the following Quiz Learning Objectives:
- Core:
- IP 5: evaluating simple expressions
- Advanced:
- FS 11: tail recursion
- FS 13: set! vs. define
- IP 7: evaluating procedures
- IP 8: handling quote
- Core:
What you should do now:
- Read the assigned readings (see below)
- Complete Interpreter Part 5: Evaluating if/let/quote
- Start Interpreter Part 6: Evaluating define/lambda
Reading assignment (to be completed by the next class):
More on tail-call optimization (from today):
- Read this opinion piece on why Python doesn’t have tail-call optimization (a.k.a. tail recursion elimination)
Types (for next Monday):