Lecture 3
LECTURE 3:
Simulation of other Paradigms and Continuations
Kurt Nørmark
Department of Computer Science, Aalborg University, Denmark
Title page
Abstract
References from this lecture
Exercises in this lecture
Source programs in this lecture
Page 1
Object-oriented Programming
Page 23
The catch and throw idea
Page 2
Functions and closures revisited
Page 24
A catch and throw example
Page 3
Classes and objects
Page 25
The intuition behind continuations
Page 4
A general pattern of classes
Page 26
Being more precise
Page 5
Example of the general class pattern
Page 27
The capturing of continuations
Page 6
A general pattern of classes with inheritance
Page 28
Capturing, storing, and applying continuations
Page 7
An example of classes with inheritance
Page 29
Use of continuations for escaping purposes
Page 8
The interpretation of self
Page 30
Practical example: Length of an improper list
Page 9
A general pattern of a class hierarchy with virtual methods
Page 31
Practical example: Searching a binary tree
Page 10
An example of virtual methods
Page 32
Continuation Passing Style
Page 11
Summing up: Simulation of OOP in Scheme
Page 33
Continuation Passing Style
Page 12
Imperative Programming
Page 34
Observations about continuation passing style
Page 13
Imperative Programming in a Functional Language
Page 35
Coroutines
Page 14
Sequential Control
Page 36
Coroutines
Page 15
Jumps in Functional Programs
Page 37
Simulating Coroutines in Scheme
Page 16
Selection Control
Page 38
A simpel producer and consumer
Page 17
Iterative Control
Page 39
Simultaneous traversal of two binary trees (1)
Page 18
Assignments in Functional Programs
Page 40
Simultaneous traversal of two binary trees (2)
Page 19
State in Functional Programs
Page 41
Trampolining
Page 20
Object Mutation
Page 42
Trampolining
Page 21
Continuations
Page 43
More exercises
Page 22
Introduction and motivation
Generated: Tuesday August 17, 2021, 12:49:21