Lecture overview -- Keyboard shortcut: 'u'  Previous page: Trampolining [Section] -- Keyboard shortcut: 'p'  Next page: More exercises -- Keyboard shortcut: 'n'  Lecture notes - all slides and notes together  slide -- Keyboard shortcut: 't'  Help page about these notes  Alphabetic index  Course home  Lecture 3 - Page 42 : 43
Programming Paradigms
Simulation of other Paradigms and Continuations
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

c:/Users/Kurt/Teaching-material/Pp-Scheme-17/notes/includes/trampoline-candidates.scmA few functions - to be trampolined below.


c:/Users/Kurt/Teaching-material/Pp-Scheme-17/notes/includes/trampoline-applications.scmAugmenting with bounce and return. This program is explained


c:/Users/Kurt/Teaching-material/Pp-Scheme-17/notes/includes/trampoline-applications-return-bounce.scmRedefining bounce and return. This program is explained


c:/Users/Kurt/Teaching-material/Pp-Scheme-17/notes/includes/trampoline-pogo-stick.scmIntroducing a single threaded scheduler: pogo-stick. This program is explained


Go to exerciseTrampolining a recursive factorial function without tail calls?!
c:/Users/Kurt/Teaching-material/Pp-Scheme-17/notes/includes/trampoline-other-schedulers.scmMultithreaded schedulers: seesaw and trampoline. This program is explained


Go to exerciseA 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