Lecture overview -- Keyboard shortcut: 'u'  Previous page: Trampolining [Section] -- Keyboard shortcut: 'p'  Next page: More exercises -- Keyboard shortcut: 'n'  Lecture notes - all slides together  Annotated slide -- Keyboard shortcut: 't'  Alphabetic index  Help page about these notes  Course home    Simulation of other Paradigms and Continuations - slide 42 : 43

Trampolining

Delayed evaluation and scheduling of a computation from an external driver

Provides for interleaved excution of several functions - as controlled by the scheduler

The starting point is some tail recursive functions

trampoline-candidates.scm
A few functions - to be trampolined below.
trampoline-applications.scm
Augmenting with bounce and return.
trampoline-applications-return-bounce.scm
Redefining bounce and return.
trampoline-pogo-stick.scm
Introducing a single threaded scheduler: pogo-stick.
Go to exercise
Trampolining a recursive factorial function without tail calls?!
trampoline-other-schedulers.scm
Multithreaded schedulers: seesaw and trampoline.
Go to exercise
A variant of seesaw that completes both threads

Trampoling can be used in a compilers - for compilation of a tail-recursive function to a loop that drives the recursion