          Lecture 3 - Page 38 : 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 capturing of continuations It is now time to introduce the Scheme primitive that allows us to capture a continuation.
 Scheme provides a primitive that captures a continuation of an expression E in a context CThe primitive is called call-with-current-continuation, or call/cc as a short aliascall/cc takes a parameter, which is a function of one parameter.The parameter of the function is bound to the continuation, and the body of the function is E
 Context C and the capturing `(+ 5 (call/cc (lambda (e) (* 4 3)) ))` `(cons 1 (cons 2 (cons 3 (call/cc (lambda (e) '()) ))))` ```(define x 5) (if (= 0 x) 'undefined (remainder (* (call/cc (lambda (e) (+ x 1)) ) (- x 1)) x))```

Use of call/cc and capturing of continuations.