Contents
Chapter 21 Designing Abstractions from Examples
Chapter 22 Designing Abstractions with First-Class Functions
Chapter 23 Mathematical Examples
Chapter 21 Designing Abstractions from Examples Abstracting from Examples Finger Exercises with Abstract List
Functions Abstraction and a Single Point of Control Extended Exercise: Moving Pictures,
Again Note: Designing Abstractions from
Templates
21.1 Abstracting from Examples
The comparison:
The abstraction:
21.1 Abstracting from Examples
The abstraction:
The test:
21.2 Finger Exercises with Abstract List Functions Built-in abstract functions (cont.)
21.2 Finger Exercises with Abstract List Functions Built-in abstract functions
21.3 Abstraction and a Single Point of Control
Guideline on Creating Abstractions Form an abstraction instead of copying and
modifying a piece of a program.
21.4 Extended Exercise: Moving Pictures, Again Move
21.5 Note: Designing Abstractions from Templates Template for lists
Abstract over this programming task
Using reduce to define functions
Chapter 22 Designing Abstractions with First-Class Functions Functions that Produce Functions Designing Abstractions with Functions-as-
Values A First Look at Graphical User Interfaces
22.1 Functions that Produce Functions how a function can produce a function
Create function that adds x to its input
22.2 Designing Abstractions with Functions-as-Values Abstraction using local (ref. figure 53, ch19)
abstraction
22.3 A First Look at Graphical User Interfaces Model-View
The ideal program consists of two completely separate components:
the MODEL, which is the kind of program we are learning to design, and a VIEW, which is the GUI program that manages the display of information and the user's mouse and keyboard manipulations. The bridge between the two is the CONTROL expression.
model contain no references to the view
22.3 A First Look at Graphical User Interfaces The gui.ss operations (cont.)
22.3 A First Look at Graphical User Interfaces There are four kinds of the data definition for gui-
items text fields,
which are created with (make-text a-string) and allow users to enter arbitrary text into an area in the window;
buttons, which are created with (make-button a-string a-function) and allow
users to apply a function with the click of a mouse button;
choice menus, which are created with (make-choice a-list-of-strings) and allow
users to pick a choice from a specified set of choices; and
message fields, which are created with (make-message a-string) and enable the
model to inform users of results.
Chapter 23 Mathematical Examples
Sequences and Series Arithmetic Sequences and Series Geometric Sequences and Series The Area Under a Function The Slope of a Function
Summary
Chapter 21 Designing Abstractions from Examples Abstracting from differences Abstraction from Template Abstract List
Chapter 22 Designing Abstractions with First-Class Functions Abstractions with Functions-as-Values Graphical User Interfaces
Chapter 23 Mathematical Examples Mathematical functions for practicing programming