From 562a9a52d599d9a05f871404050968a5fd282640 Mon Sep 17 00:00:00 2001 From: elioat Date: Wed, 23 Aug 2023 07:52:19 -0400 Subject: * --- js/games/nluqo.github.io/~bh/ss/ack.html | 97 ++++++++++++ js/games/nluqo.github.io/~bh/ss/foreword.html | 107 +++++++++++++ js/games/nluqo.github.io/~bh/ss/instructor.html | 202 ++++++++++++++++++++++++ 3 files changed, 406 insertions(+) create mode 100644 js/games/nluqo.github.io/~bh/ss/ack.html create mode 100644 js/games/nluqo.github.io/~bh/ss/foreword.html create mode 100644 js/games/nluqo.github.io/~bh/ss/instructor.html (limited to 'js/games/nluqo.github.io/~bh/ss') diff --git a/js/games/nluqo.github.io/~bh/ss/ack.html b/js/games/nluqo.github.io/~bh/ss/ack.html new file mode 100644 index 0000000..105146d --- /dev/null +++ b/js/games/nluqo.github.io/~bh/ss/ack.html @@ -0,0 +1,97 @@ + + +Simply Scheme Acknowledgments + + +Simply Scheme 2/e Copyright (C) 1999 MIT +

Acknowledgments

+ +
+

cover photo +

+Brian +Harvey
Matthew +Wright
University of California, Berkeley
+

MIT +Press web page for Simply Scheme +
+ +

(back to Table of Contents) + +


+ +

Obviously our greatest debt is to Harold Abelson, +Gerald Jay Sussman, and Julie Sussman. They have +inspired us and taught us, and gave birth to the movement to which we are +minor contributors. Julie carefully read what we thought was the final +draft, made thousands of suggestions, both small and large, improved the +book enormously, and set us back two months. Hal encouraged us, read early +drafts, and also made this a better book than we could have created on our +own. + +

+Mike Clancy, Ed Dubinsky, Dan Friedman, and +Tessa Harvey also read drafts and made detailed and very helpful +suggestions for improvement. Mike contributed many exercises. +(We didn't take their advice about everything, though, so they get none of +the blame for anything you don't like here.) + +

Terry Ehling and everyone at the MIT Press have given this +project the benefit of their enthusiasm and their technical support. We're +happy to be working with them. + +

The Computer Science Division at the University of California, Berkeley, +allowed us to teach a special section of the CS 3 course using the first +draft of this book. The book now in your hands is much better because of +that experience. We thank Annika Rogers, our teaching assistant +in the course, and also the thirty students who served not merely as guinea +pigs but as collaborators in pinning down the weak points in our +explanations. + +

Some of the ideas in this book, especially the different approaches to +recursion, are taken from Brian's earlier Logo-based +textbook.* +Many of our explanatory metaphors, especially the "little people" model, +were invented by members of the Logo community. We also took the word and +sentence data types from Logo. Although this book doesn't use Logo itself, +we tried to write it in the Logo spirit. + +

*Computer Science Logo Style, volume 1: +Intermediate Programming, MIT Press, 1985.
+ +

We wrote much of this book during the summer of 1992, while we were on the +faculty of the Institute for Secondary Mathematics and Computer Science +Education, an inservice teacher training program at Kent State University. +Several of our IFSMACSE colleagues contributed to our ideas both about +computer science and about teaching; we are especially indebted to +Ed Dubinsky and Uri Leron. + +

We stole the idea of a "pitfalls" section at the end of each chapter from +Dave Patterson and John Hennessy. + +

We stole some of the ideas for illustrations from Douglas +Hofstadter's wonderful Godel, Escher, Bach. + +

David Zabel helped with the preparation of the program diskettes, +especially with compiling SCM for the PC. + +

We conclude this list with an acknowledgment of each other. Because of the +difference in our ages, it may occur to some readers to suspect that we +contributed unequally to this book--either that Matt did all the work and +Brian just lent his name and status to impress publishers, or that Brian had +all the ideas and Matt did the typing. Neither of these is true. Almost +everything in the book was written with both of us in front of the computer, +arguing out every paragraph. When we did split up to write some sections +separately, each of us read and criticized the other's work. (We're a +little surprised that we still like each other, after all the arguments!) +Luckily we both like the Beatles, +Chinese food, and ice cream, so we had a common ground for +programming examples. But when you see an example about +Bill Frisell, you can be pretty sure it's Matt's writing, and when +the example is about Dave Dee, Dozy, Beaky, Mick, and Tich, it's probably +Brian's. + +

(back to Table of Contents) + + + diff --git a/js/games/nluqo.github.io/~bh/ss/foreword.html b/js/games/nluqo.github.io/~bh/ss/foreword.html new file mode 100644 index 0000000..b678405 --- /dev/null +++ b/js/games/nluqo.github.io/~bh/ss/foreword.html @@ -0,0 +1,107 @@ + + +Simply Scheme Foreword + + +Simply Scheme 2/e Copyright (C) 1999 MIT +

Foreword

+ +
+

cover photo +

+Brian +Harvey
Matthew +Wright
University of California, Berkeley
+Foreword by Hal Abelson
+

MIT +Press web page for Simply Scheme +
+ +

(back to Table of Contents) + +


+ +

One of the best ways to stifle the growth of an idea is to enshrine it +in an educational curriculum. The textbook publishers, certification +panels, professional organizations, the folks who write the college +entrance exams--once they've settled on an approach, they +become frozen in a straitjacket of interlocking constraints that +thwarts the ability to evolve. So it is common that students learn +the "modern" geography of countries that no longer exist and +practice using logarithm tables when calculators have made tables +obsolete. And in computer science, beginning courses are trapped in +an approach that was already ten years out of date by the time it was +canonized in the mid 80s, when the College Entrance Examination Board +adopted an advanced placement exam based on Pascal. + +

This book points the way out of the trap. It emphasizes programming +as a way to express ideas, rather than just a way to get computers to +perform tasks. + +

Julie and Gerry Sussman and I are flattered that Harvey and Wright +characterize their revolutionary introduction to computer science as a +"prequel" to our text Structure and Interpretation of Computer +Programs. When we were writing SICP, we often drew upon +the words of the great American computer scientist Alan Perlis +(1922-1990). Perlis was one of the designers of the Algol +programming language, which, beginning in 1958, established the +tradition of formalism and precision that Pascal embodies. Here's +what Perlis had to say about this tradition in 1975, +nine years before the start of the AP exam: + +

+Algol is a blight. You can't have fun with Algol. Algol is a code +that now belongs in a plumber's union. It helps you design correct +structures that don't collapse, but it doesn't have any fun in it. +There are no pleasures in writing Algol programs. It's a labor of +necessity, a preoccupation with the details of tedium. +
+ +

Harvey and Wright's introduction to computing emerges from a different +intellectual heritage, one rooted in research in artificial +intelligence and the programming language Lisp. In approaching +computing through this book, you'll focus on two essential techniques. + +

First is the notion of symbolic programming. This means that +you deal not only with numbers and letters, but with structured +collections of data--a word is a list of characters, a sentence is a +list of words, a paragraph is a list of sentences, a story is a list +of paragraphs, and so on. You assemble things in terms of natural +parts, rather than always viewing data in terms of its tiniest pieces. +It's the difference between saying "find the fifth character of the +third word in the sentence" and "scan the sentence until you pass +two spaces, then scan past four more characters, and return the next +character." + +

The second technique is to work with higher-order functions. +That means that you don't only write programs, but rather you write +programs that write programs, so you can bootstrap your methods +into more powerful methods. + +

These two techniques belong at center stage in any beginning +programming course, which is exactly where Harvey and Wright put them. +The underlying principle in both cases is that you work with general +parts that you extend and combine in flexible ways, rather than tiny +fragments that you fit together into rigid structures. + +

You should come to this introduction to computing ready to think about +ideas rather than details of syntax, ready to design your own +languages rather than to memorize the rules of languages other people +have designed. This kind of activity changes your outlook not only on +programming, but on any area where design plays an important role, +because you learn to appreciate the relations among parts rather than +always fixating on the individual pieces. To quote Alan Perlis again, + +

+You begin to think in terms of patterns and idioms and phrases, and no +longer pick up a trowel and some cement and lay things down brick by +brick. The Great Wall, standing for centuries, is a monument. But +building it must have been a bore. +
+ +

Hal Abelson +
Cambridge, MA + +

(back to Table of Contents) + + diff --git a/js/games/nluqo.github.io/~bh/ss/instructor.html b/js/games/nluqo.github.io/~bh/ss/instructor.html new file mode 100644 index 0000000..6bb2a0f --- /dev/null +++ b/js/games/nluqo.github.io/~bh/ss/instructor.html @@ -0,0 +1,202 @@ + + +Simply Scheme: To the Instructor + + +Simply Scheme 2/e Copyright (C) 1999 MIT +

To the Instructor

+ +
+

cover photo +

+Brian +Harvey
Matthew +Wright
University of California, Berkeley
+

MIT +Press web page for Simply Scheme +
+ +

(back to Table of Contents) + +


+ +

The language that we use in this book isn't exactly standard Scheme. We've +provided several extensions that may seem unusual to an experienced Scheme +programmer. This may make the book feel weird at first, but there's a +pedagogic reason for each extension. + +

Along with our slightly strange version of Scheme, our book has a slightly +unusual order of topics. Several ideas that are introduced very early in +the typical Scheme-based text are delayed in ours, most notably recursion. +Quite a few people have looked at our table of contents, noted some +particular big idea of computer science, and remarked, "I can't believe +you wait so long before getting to such and such!" + +

In this preface for instructors, we describe and explain the unusual +elements of our approach. Other teaching issues, including the timing and +ordering of topics, are discussed in the Instructor's Manual. + +

Lists and Sentences

+ +

The chapter named "Lists" in this book is Chapter 17, about halfway +through the book. But really we use lists much earlier than that, almost +from the beginning. + +

Teachers of Lisp have always had trouble deciding when and how to introduce +lists. The advantage of an early introduction is that students can then +write interesting symbolic programs instead of boring numeric ones. The +disadvantage is that students must struggle with the complexity of the +implementation, such as the asymmetry between the two ends of a list, while +still also struggling with the idea of composition of functions and Lisp's +prefix notation. + +

We prefer to have it both ways. We want to spare beginning students the +risk of accidentally constructing ill-formed lists such as + +

((((() . D) . C) . B) . A)
+
+ +

but we also want to write natural-language programs from the +beginning of the book. Our solution is to borrow from Logo the idea of a +sentence abstract data type.* Sentences are +guaranteed to be flat, proper lists, and they appear to be symmetrical to +the user of the abstraction. (That is, it's as easy to ask for the last +word of a sentence as to ask for the first word.) The sentence +constructor accepts either a word or a sentence in any argument position. + +

*Speaking of abstraction, even +though that's the name of Part V, we do make an occasion in each of the +earlier parts to talk about abstraction as examples come up.

We defer structured lists until we have higher-order functions and +recursion, the tools we need to be able to use the structure +effectively.* A +structured list can be understood as a tree, and Lisp programmers generally +use that understanding implicitly. We create an explicit abstract data type +for trees and use it for a thorough exploration of tree structure, without +reference to the implementation of trees. We then explicitly connect the +usual informal tree recursion on structured lists to our more formal version. + +

*Even then, we take lists as a primitive data type. We +don't teach about pairs or improper lists, except as a potential pitfall.

Sentences and Words

+ +

We haven't said what a word is. Scheme includes separate data types +for characters, symbols, strings, and numbers. We want to be able to +dissect words into letters, just as we can dissect sentences into words, so +that we can write programs like plural and pig-latin. Orthodox +Scheme style would use strings for such purposes, but we want a sentence to +look (like this) and not ("like" "this"). We've arranged that +in most contexts symbols, strings, and numbers can be used interchangeably; +our readers never see Scheme characters at all.* +Although a word made of letters is represented internally as a symbol, while +a word made of digits is represented as a number, above the abstraction line +they're both words. (A word that standard Scheme won't accept as a symbol +nor as a number is represented as a string.) + +

*Scheme's primitive +I/O facility gives you the choice of expressions or characters. Instead of +using read-char, we invent read-line, which reads a line as a +sentence, and read-string, which returns the line as one long word.

There is an efficiency cost to treating both words and sentences as abstract +aggregates, since it's slow to disassemble a sentence from right to left and +slow to disassemble a word in either direction. Many simple procedures that +seem linear actually behave quadratically. Luckily, words aren't usually +very long, and the applications we undertake in the early chapters don't use +large amounts of data in any form. We write our large projects as +efficiently as we can without making the programs unreadable, but we +generally don't make a fuss about it. Near the end of the book we discuss +explicitly the efficient use of data structures. + +

Overloading in the Text Abstraction

+ +

Even though computers represent numbers internally in many different ways +(fixed point, bignum, floating point, exact rational, complex), when people +visit mathland, they expect to meet numbers there, and they expect that all +the numbers will understand how to add, subtract, multiply, and divide with +each other. (The exception is dividing by zero, but that's because of the +inherent rules of mathematics, not because of the separation of numbers into +categories by representation format.) + +

We feel the same way about visiting textland. We expect to meet English +text there. It takes the form of words and sentences. The operations that +text understands include first, last, butfirst, and +butlast to divide the text into its component parts. You can't divide an +empty word or sentence into parts, but it's just as natural to divide a word +into letters as to divide a sentence into words. (The ideas of mathland and +textland, as well as the details of the word and sentence procedures, come +from Logo.) + +

Some people who are accustomed to Scheme's view of data types consider +first to be badly "overloaded"; they feel that a procedure that selects an +element from a list shouldn't also extract a letter from a symbol. Some of +them would prefer that we use car for lists, use substring for +strings, and not disassemble symbols at all. Others want us to define +word-first and sentence-first. + +

To us, word-first and sentence-first sound no less awkward than +fixnum-+ and bignum-+. Everyone agrees that it's reasonable to +overload the name + because the purposes are so similar. Our students +find it just as reasonable that first works for words as well as for +sentences; they don't get confused by this. + +

As for the inviolability of symbols--the wall between names and data--we +are following an older Lisp tradition, in which it was commonplace to +explode symbols and to construct new names within a program. Practically +speaking, all that prevents us from representing words as strings is that +Scheme requires quotation marks around them. But in any case, the +abstraction we're presenting is that the data we're dissecting are neither +strings nor symbols, but words. + +

Higher-Order Procedures, Lambda, and Recursion

+ +

Scheme relies on procedure invocation as virtually its only control +mechanism. In order to write interesting programs, a Scheme user must +understand at least one of two hard ideas: recursion or procedure as object +(in order to use higher-order procedures). We believe that higher-order +procedures are easier to learn, especially because we begin in Chapter +8 by applying them only to named procedures. Using a named procedure +as an argument to another procedure is the way to use procedures as objects +that's least upsetting to a beginner. After the reader is comfortable with +higher-order procedures, we introduce lambda; after that we introduce +recursion. We do the tic-tac-toe example with higher-order procedures and +lambda, but not recursion. + +

When we get to recursion, we begin with an example of embedded recursion. +Many books begin with the simplest possible recursive procedure, which turns +out to be a simple sequential recursion, or even a tail recursion. We feel +that starting with such examples allows students to invent the "go back" +model of recursion as looping. + +

Mutators and Environments

+ +

One of the most unusual characteristics of this book is that there is no +assignment to variables in it. The reason we avoid set! is that the +environment model of evaluation is very hard for most students. We use a +pure substitution model throughout most of the book. (With the background +they get from this book, students should be ready for the environment model +when they see a rigorous presentation, as they will, for example, in Chapter +3 of SICP.) + +

As the last topic in the book, we do introduce a form of mutation, namely +vector-set!. Mutation of vectors is less problematic than mutation of +lists, because lists naturally share storage. You really have to go out of +your way to get two pointers to the same vector.* Mutation of data +structures is less problematic than assignment to variables because it +separates the issue of mutation from the issues of binding and scope. Using +vectors raises no new questions about the evaluation process, so we present +mutation without reference to any formal model of evaluation. We +acknowledge that we're on thin ice here, but it seems to work for our +students. + +

*We don't talk about +eq? at all. We're careful to write our programs in such a way that +the issue of identity doesn't arise for the reader.

In effect, our model of mutation is the "shoebox" model that you'd find in +a mainstream programming language text. Before we get to mutation, we use +input/output programming to introduce the ideas of effect and sequence; +assigning a value to a vector element introduces the important idea of +state. We use the sequential model to write two more or less practical +programs, a spreadsheet and a database system. A more traditional approach +to assignment in Scheme would be to build an object-oriented language +extension, but the use of local state variables would definitely force us to +pay attention to environments. + +

(back to Table of Contents) + + -- cgit 1.4.1-2-gfad0