Lesson 22: Tail Recursion, continued

Outline:

  1. Recap: tail-call optimization
    • recognizing tail recursion
    • writing tail-recursive functions
  2. [If time] Function pointers
    • syntax in C
    • functions vs. special forms in Scheme
  3. 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

What you should do now:

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):