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/part5.html | 75 +++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 js/games/nluqo.github.io/~bh/part5.html (limited to 'js/games/nluqo.github.io/~bh/part5.html') diff --git a/js/games/nluqo.github.io/~bh/part5.html b/js/games/nluqo.github.io/~bh/part5.html new file mode 100644 index 0000000..85453e7 --- /dev/null +++ b/js/games/nluqo.github.io/~bh/part5.html @@ -0,0 +1,75 @@ + + +Simply Scheme part V introduction + + +Simply Scheme 2/e Copyright (C) 1999 MIT +

Abstraction

+ +
+

cover photo +

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

MIT +Press web page for Simply Scheme +
+ +

(back to Table of Contents) + +


+ +

We've really been talking about abstraction all along. Whenever you find +yourself performing several similar computations, such as + +

+> (sentence 'she (word 'run 's))
+(SHE RUNS)
+
+> (sentence 'she (word 'walk 's))
+(SHE WALKS)
+
+> (sentence 'she (word 'program 's))
+(SHE PROGRAMS)
+
+ +and you capture the similarity in a procedure + +
+(define (third-person verb)
+  (sentence 'she (word verb 's)))
+
+ +

you're abstracting the pattern of the computation by +expressing it in a form that leaves out the particular verb in any one +instance. + +

In the preface we said that our approach to computer science is to teach you +to think in larger chunks, so that you can fit larger problems in your mind +at once; "abstraction" is the technical name for that chunking process. + +

In this part of the book we take a closer look at two specific kinds of +abstraction. One is data abstraction, which means the invention of +new data types. The other is the implementation of higher-order +functions, an important category of the same process abstraction of which +third-person is a trivial example. + +

Until now we've used words and sentences as though they were part of the +natural order of things. Now we'll discover that Scheme sentences exist +only in our minds and take shape through the use of constructors and +selectors (sentence, first, and so on) that we wrote. The +implementation of sentences is based on a more fundamental data type called +lists. Then we'll see how lists can be used to invent another +in-our-minds data type, trees. (The technical term for an invented +data type is an abstract data type.) + +

You already know how higher-order functions can express many computational +processes in a very compact form. Now we focus our attention on the +higher-order procedures that implement those functions, exploring +the mechanics by which we create these process abstractions. + +

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