Lecture overview -- Keyboard shortcut: 'u'  Previous page: Delayed evaluation and infinite lists in Scheme [Section] -- Keyboard shortcut: 'p'  Next page: Examples of delayed evaluation -- Keyboard shortcut: 'n'  Lecture notes - all slides and notes together  slide -- Keyboard shortcut: 't'  Help page about these notes  Alphabetic index  Course home  Lecture 4 - Page 21 : 27
Programming Paradigms
Evaluation Order and Infinite Lists
Delayed evaluation in Scheme

Scheme does not support normal-order reduction nor lazy evaluation

But Scheme has an explicit primitive which delays an evaluation


(delay expr) => promise


(force promise) => value

c:/Users/Kurt/Teaching-material/Pp-Scheme-17/notes/includes/delay-force-principle.scmA principled implementation of delay and force in Scheme.


c:/Users/Kurt/Teaching-material/Pp-Scheme-17/notes/includes/delay-force.scmReal implementations of delay and force.

The first definition uses the R5RS macro facility, whereas the last one uses a more primitive macro facility, which happens to be supported in MzScheme.