diff options
author | elioat <elioat@tilde.institute> | 2023-08-23 07:52:19 -0400 |
---|---|---|
committer | elioat <elioat@tilde.institute> | 2023-08-23 07:52:19 -0400 |
commit | 562a9a52d599d9a05f871404050968a5fd282640 (patch) | |
tree | 7d3305c1252c043bfe246ccc7deff0056aa6b5ab /js/games/nluqo.github.io/~bh/part5.html | |
parent | 5d012c6c011a9dedf7d0a098e456206244eb5a0f (diff) | |
download | tour-562a9a52d599d9a05f871404050968a5fd282640.tar.gz |
*
Diffstat (limited to 'js/games/nluqo.github.io/~bh/part5.html')
-rw-r--r-- | js/games/nluqo.github.io/~bh/part5.html | 75 |
1 files changed, 75 insertions, 0 deletions
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 @@ +<HTML> +<HEAD> +<TITLE>Simply Scheme part V introduction</TITLE> +</HEAD> +<BODY> +<CITE>Simply Scheme</CITE> 2/e Copyright (C) 1999 MIT +<H1>Abstraction</H1> + +<TABLE><TR><TD> +<P><IMG SRC="simply.jpg" ALT="cover photo"> +<TD valign="center"> +<CITE><A HREF="http://www.cs.berkeley.edu/~bh/">Brian +Harvey</A><BR><A HREF="http://www.cnmat.berkeley.edu/~matt">Matthew +Wright</A><BR>University of California, Berkeley</CITE> +<BR><BR><A HREF="http://www-mitpress.mit.edu/book-home.tcl?isbn=0262082810">MIT +Press web page for Simply Scheme</A> +</TABLE> + +<P><A HREF="simply-toc.html">(back to Table of Contents)</A> + +<HR> + +<P>We've really been talking about abstraction all along. Whenever you find +yourself performing several similar computations, such as + +<PRE> +> (sentence 'she (word 'run 's)) +(SHE RUNS) + +> (sentence 'she (word 'walk 's)) +(SHE WALKS) + +> (sentence 'she (word 'program 's)) +(SHE PROGRAMS) +</PRE> + +and you capture the similarity in a procedure + +<PRE> +(define (third-person verb) + (sentence 'she (word verb 's))) +</PRE> + +<P>you're <EM>abstracting</EM> the pattern of the computation by +expressing it in a form that leaves out the particular verb in any one +instance. + +<P>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. + +<P>In this part of the book we take a closer look at two specific kinds of +abstraction. One is <EM>data abstraction,</EM> which means the invention of +new data types. The other is the implementation of <EM>higher-order +functions,</EM> an important category of the same process abstraction of which +<CODE>third-person</CODE> is a trivial example. + +<P>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 (<CODE>sentence</CODE>, <CODE>first</CODE>, and so on) that we wrote. The +implementation of sentences is based on a more fundamental data type called +<EM>lists.</EM> Then we'll see how lists can be used to invent another +in-our-minds data type, <EM>trees.</EM> (The technical term for an invented +data type is an <EM>abstract</EM> data type.) + +<P>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 <EM>procedures</EM> that implement those functions, exploring +the mechanics by which we create these process abstractions. + +<P><A HREF="simply-toc.html">(back to Table of Contents)</A> + +</BODY> +</HTML> |