Education For All

Text size
  • Increase font size
  • Default font size
  • Decrease font size


Course Home

Programming Paradigms - Lecture 21

Get the Flash Player to view video.
Lecture 21 - Kawa Development Environment, Mapping Functions

Introduction to the Kawa Development Environment: Evaluation of Expressions, Loading Function Definitions From a .Scm File, Mapping Arbitrary Unary Functions Over Lists in Scheme Using the Map Operation, Mapping List Functions (Car, Cdr) Over Lists of Lists, Using Mapping Functions with More than One Input by Passing Multiple Lists into Map, Implementing the Unary Version of Map Using Recursion, Apply, Which Allows You to Specify a Function to Be Prepended to a List of Arguments and Be Evaluated, and Eval, Which Evaluates a List as Though it Were Typed into the Commandline, Using Apply to Implement an Average Function Wihtout Recursion, How Eval Can Be Used to Apply Non-Functions Like 'And' and 'Define' to a List, or to Evaluate a Complicated Expression Created While the Program Is Running, Revisiting Flatten Using Map and Apply, Writing a Flatten Implementation That Maps Itself Over Each of its Elements and Appends Each of the Results Together Using Apply, Implementing a Translate Function, Which Shifts Each Point in a List of Points by a Certain Delta, How a Typical Mapping Function Is Not Usable Because of its Need for Client Data, Using the Lambda Function to Define a Nameless Function On the Fly, Which Can Access the Delta Value Since it Is Constructed within the Translate Function, Defining Functions within Functions as an Alternative to Using Lambda, How the Define Keyword Implicitly Uses the Lambda Keyword to Associate a Name with a Function

Prof. Jerry Cain
CS107 Programming Paradigms
(Stanford University: Stanford Engineering Everywhere)
Date accessed: 2009-05-09
License: Creative Commons Attribution 3.0

Lecture Material

Supplementary lecture material is listed below.

1. Functions as Data
2. Scheme Examples
3. Assignment 7
4. Assignment 7 Solutions



Chinese (Simplified) French German Italian Japanese Korean Portuguese Russian Spanish
More educational resources: