          Lecture 3 - Page 2 : 42
 Functional Programming in SchemeName binding, Recursion, Iteration, and Continuations * Name binding constructs The let name binding expression The equivalent meaning of let Examples with let name binding The let* name binding construct An example with let* The letrec namebinding construct LAML time functions * Conditional expressions Conditional expressions Examples with if Example with cond: leap-year? Example with cond: american-time Example with cond: as-string * Recursion and iteration Recursion List processing Tree processing (1) Tree processing (2) Recursion versus iteration Example of recursion: number-interval Examples of recursion: string-merge Examples with recursion: string-of-char-list? Exercises * Example of recursion: Hilbert Curves Hilbert Curves Building Hilbert Curves of order 1 Building Hilbert Curves of order 2 Building Hilbert Curves of order 3 Building Hilbert Curves of order 4 A program making Hilbert Curves * Continuations Introduction and motivation The catch and throw idea A catch and throw example The intuition behind continuations Being more precise The capturing of continuations Capturing, storing, and applying continuations Use of continuations for escaping purposes Practical example: Length of an improper list Practical example: Searching a binary tree
 The let name binding expression
 A name binding expression establishes a number of local name bindings in order to ease the evaluation of a body expression

In a name binding construct a number of names are bound to values. The name bindings can be used in the body, which must be an expression when we are working in the functional paradigm. There are a number of variations in the way the names can refer to each other mutually. We will meet some of them on the following pages.

 ``` (let ((n1 e1) ... (nk ek)) body-expr)```

The names n 1 ... n k are bound to the respective values e 1 ... e k , and the body expression is evaluated relative to these name bindings. Free names in the body expression are bound to names defined in the surround of the let construct.

 Characteristics of a let construct:In body-expr n1 refers to the value of e1, ..., and nk refers to the value of ekSyntactic sugar for an immediate call of a lambda expressionTo be illustrated on the next pageAs a consequence, the names are bound simultaneously relative to the name bindings in effect in the context of the let construct.