Simply Scheme: Introducing Computer Science / Edition 1

Simply Scheme: Introducing Computer Science / Edition 1

by Brian Harvey, Matthew Wright

ISBN-10: 0262082268

ISBN-13: 9780262082266

Pub. Date: 04/28/1994

Publisher: MIT Press

This lively introduction to computer science and computer programming in Scheme is for non-computer science majors with a strong interest in the subject and for computer science majors who lack prior programming experience. The text allows the student to experience the computer as a tool for expressing ideas, not as a frustrating set of mathematical obstacles. This


This lively introduction to computer science and computer programming in Scheme is for non-computer science majors with a strong interest in the subject and for computer science majors who lack prior programming experience. The text allows the student to experience the computer as a tool for expressing ideas, not as a frustrating set of mathematical obstacles. This goal is supported by the use of Scheme, a modern dialect of Lisp, designed to emphasize symbolic programming.

Product Details

MIT Press
Publication date:
Edition description:
Older Edition
Product dimensions:
8.34(w) x 9.36(h) x 1.59(d)

Table of Contents

One Big Idea: Symbolic Programming
Lisp and Radical Computer Science
Who Should Read This Book
How to Read This Book
To the Instructor
Lists and Sentences
Sentences and Words
Overloading in the TeXt Abstraction
HigherOrder Procesdures, Lambda, and Recursion
Mutators and Environments
AcknowledgmentsI Introduction: Functions
1 Showing Off Scheme
Talking to Scheme
Recovering from Typing Errors
EXiting Scheme
More EXamples
EXample: Acronyms
EXample: Pig Latin
EXample: Ice Cream Choices
EXample: Combinations from a Set
EXample: Factorial
Play with the Procedures
2 Functions
Domain and Range
More Types: Sentences and Booleans
Our Favorite Type: Functions
Play with It
Thinking about What You've Done
II Composition of Functions
3 EXpressions
Little People
Result Replacement
Plumbing Diagrams
4 Defining Your Own Procedures
How to Define a Procedure
Special Forms
Functions and Procedures
Argument Names versus Argument Values
Procedure as Generalization
The Substitution Model
5 Words and Sentences
FirstClass Words and Sentences
6 True and False
Using Predicates
If Is a Special Form
So Are And and face=courier>Or
Everything That Isn't False Is True
Decisions, Decisions, Decisions
If Is Composable
7 Variables
How Little People Do Variables
Global and Local Variables
The Truth about Substitution
III Functions as Data
8 HigherOrder Functions
A Pausefor Reflection
Combining HigherOrder Functions
Choosing the Right Tool
FirstClass Functions and FirstClass Sentences
9 Lambda
Procedures That Return Procedures
The Truth about Define
The Truth about Let
Name Conflicts
Named and Unnamed Functions
Project: Bridge Hands
10 EXample: TicTacToe
A Warning
Technical Terms in TicTacToe
Thinking about the Program Structure
The First Step: Triples
Finding the Triples
Using Every with TwoArgument Procedures
Can the Computer Win on This Move?
If So, in Which Square?
Second Verse, Same as the First
Now the Strategy Gets Complicated
Finding the Pivots
Taking the Offensive
Complete Program Listing
IV Recursion
11 Introduction to Recursion
A Separate Procedure for Each Length
Use What You Have to Get What You Need
Notice That They're All the Same
Notice That They're Almost All the Same
Base Cases and Recursive Calls
Pig Latin
Problems for You to Try
Our Solutions
12 The Leap of Faith
From the Combining Method to the Leap of Faith
EXample: Reverse
The Leap of Faith
The Base Case
EXample: Factorial
Likely Guesses for Smaller Subproblems
EXample: Downup
EXample: Evens
Simplifying Base Case
13 How Recursion Works
Little People and Recursion
14 Common Patterns in Recursive
The Every Pattern
The Keep Pattern
The Accumulate Pattern
Combining Patterns
Helper Procedures
How to Use Recursive Patterns
Problems That Don't Follow Patterns
Project: Names of Huge Numbers
Advanced Recursion
EXample: Sort
EXample: FromBinary
EXample: Mergesort
EXample: Subsets
Projects: Poker Hands
EXtra Work for Hotshots
16 EXample: Pattern Matcher
Problem Description
Implementation: When Are Two Sentences Equal?
When Are Two Sentences Nearly Equal?
Matching with Alternatives
Matching Several Words
Combining the Placeholders
Naming the Matched TeXt
The Final Version
Abstract Data Types
Backtracking and KnownValues
How We Wrote It
Complete Program Listing
V Abstraction
17 Lists
Selectors and Constructors
Programming with Lists
The Truth about Sentences
HigherOrder Functions
Other Primitives for Lists
Association Lists
Functions That Take Variable Numbers of Arguments
Recursion on Arbitary Structured Lists
18 Trees
EXample: The World
How Big Is My Tree?
Mutual Recursion
Searching for a Datum in the Tree
Locating a Datum in the Tree
Representing Trees as Lists
Abstract Data Types
An Advanced EXample: Parsing Arithmetic EXpressions
19 Implementing HigherOrder Functions
Generalizing Patterns
The Every Pattern Revisited
The Difference between Map and face=courier>Every
Accumulate and face=courier>Reduce
HigherOrder Functions for Structured Lists
The ZeroTrip Do Loop
VI Sequential Programming
20 Input and Output
Side Effects and Sequencing
The Begin Special Form
This Isn't Functional Programming
Not Moving to the NeXt Line
A HigherOrder Procedure for Sequencing
TicTacToe Revisited
Accepting User Input
Aesthetic Board Display
Reading and Writing Normal TeXt
Formatted TeXt
Sequential Programming and Order of Evaluation
21 EXample: The face=courier>Functions Program
The Main Loop
The Difference between a Procedure and Its Name
The Association List of Functions
Domain Checking
Intentionally Confusing a Function with Its Name
More on HigherOrder Functions
More Robustness
Complete Program Listing
22 Files
Writing Files for People to Read
Using a File as a Database
Transforming the Lines of a File
Justifying TeXt
Preserving Spacing of TeXt from Files
Merging Two Files
Writing Files for Scheme to Read
23 Vectors
The Indy 500
Using Vectors in Programs
NonFunctional Procedures and State
Shuffling a Deck
More Vector Tools
The Vector Pattern of Recursion
Vectors versus Lists
State, Sequence, and Effects
24 EXample: A Spreadsheet Program
Limitations of Our Spreadsheet
Spreadsheet Commands
Moving the Selection
Putting Values in Cells
Displaying Formula Values
Loading Spreadsheet Commands from a File
Application Programs and Abstraction
25 Implementing the Spreadsheet
Cells, Cell Names, and Cell IDs
The Command Processor
Cell Selection Commands
The Load Command
The Put Command
The Formula Translator
The Dependency Manager
The EXpression Evaluator
The Screen Printer
The Cell Manager
Complete Program Listing
Project: A Database Program
A Sample Session with Our Database
How Databases Are Stored Internally
The Current Database
Implementing the Database Program Commands
Additions to the Program
EXtra Work for Hotshots
VII Conclusion: Computer Science
26 What's NeXt?
The Best Computer Science Book
Beyond SICP
Standard Scheme
Last Words
A Running Scheme
The Program Development Cycle
Integrated Editing
Getting Our Programs
Tuning Our Programs for Your System
Loading Our Programs
Versions of Scheme
Scheme Standards
B Common Lisp
Why Common Lisp EXists
Defining Procedures and Variables
The Naming Convention for Predicates
No Words or Sentences
True and False
Equivalents to Scheme Primitives
A Separate Name Space for Procedures
More about Function
Writing HigherOrder Procedures
C Scheme Initialization File
D GNU General Public License
Alphabetical Table of Scheme Primitives
IndeX of Defined Procedures
General IndeX

Customer Reviews

Average Review:

Write a Review

and post it to your social network


Most Helpful Customer Reviews

See all customer reviews >