Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Instant Download Structure and Interpretation of Computer Programs 2e JavaScript Edition Harold Abelson PDF All Chapters

Download as pdf or txt
Download as pdf or txt
You are on page 1of 40

Get ebook downloads in full at ebookmeta.

com

Structure and Interpretation of Computer Programs


2e JavaScript Edition Harold Abelson

https://ebookmeta.com/product/structure-and-interpretation-
of-computer-programs-2e-javascript-edition-harold-abelson/

OR CLICK BUTTON

DOWNLOAD NOW

Explore and download more ebook at https://ebookmeta.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

Functional Programming in JavaScript How to improve your


JavaScript programs using functional techniques 1st
Edition Luis Atencio
https://ebookmeta.com/product/functional-programming-in-javascript-
how-to-improve-your-javascript-programs-using-functional-
techniques-1st-edition-luis-atencio-2/
ebookmeta.com

Functional Programming in JavaScript How to improve your


JavaScript programs using functional techniques 1st
Edition Luis Atencio
https://ebookmeta.com/product/functional-programming-in-javascript-
how-to-improve-your-javascript-programs-using-functional-
techniques-1st-edition-luis-atencio/
ebookmeta.com

Understanding Quantum Raffles Quantum Mechanics on an


Informational Approach Structure and Interpretation
Michael Janas
https://ebookmeta.com/product/understanding-quantum-raffles-quantum-
mechanics-on-an-informational-approach-structure-and-interpretation-
michael-janas/
ebookmeta.com

Red Lip Theology: For Church Girls Who've Considered


Tithing to the Beauty Supply Store When Sunday Morning
Isn't Enough 1st Edition Candice Marie Benbow
https://ebookmeta.com/product/red-lip-theology-for-church-girls-whove-
considered-tithing-to-the-beauty-supply-store-when-sunday-morning-
isnt-enough-1st-edition-candice-marie-benbow/
ebookmeta.com
Mountain Landscapes in Transition Effects of Land Use and
Climate Change 1st Edition Udo Schickhoff R B Singh Suraj
Mal
https://ebookmeta.com/product/mountain-landscapes-in-transition-
effects-of-land-use-and-climate-change-1st-edition-udo-schickhoff-r-b-
singh-suraj-mal-2/
ebookmeta.com

The Oxford Companion to the Brontes Anniversary edition


Oxford Companions Alexander

https://ebookmeta.com/product/the-oxford-companion-to-the-brontes-
anniversary-edition-oxford-companions-alexander/

ebookmeta.com

A Fusion of Artificial Intelligence and Internet of Things


for Emerging Cyber Systems Intelligent Systems Reference
Library 210 Pardeep Kumar
https://ebookmeta.com/product/a-fusion-of-artificial-intelligence-and-
internet-of-things-for-emerging-cyber-systems-intelligent-systems-
reference-library-210-pardeep-kumar/
ebookmeta.com

Runes and Astrology Symbol and Starcraft in the Northern


Tradition 3rd Edition Nigel Pennick

https://ebookmeta.com/product/runes-and-astrology-symbol-and-
starcraft-in-the-northern-tradition-3rd-edition-nigel-pennick/

ebookmeta.com

Not Yet Megan Borgert Spaniol

https://ebookmeta.com/product/not-yet-megan-borgert-spaniol/

ebookmeta.com
Communication & Human Behavior 7th Edition Brent D Ruben

https://ebookmeta.com/product/communication-human-behavior-7th-
edition-brent-d-ruben/

ebookmeta.com
Structure and Interpretation of Computer Programs
JavaScript Edition
Structure and Interpretation of Computer Programs
JavaScript Edition

Harold Abelson and Gerald Jay Sussman


adapted to JavaScript by Martin Henz and Tobias Wrigstad
with Julie Sussman

The MIT Press


Cambridge, Massachusetts
London, England
© 2022 Massachusetts Institute of Technology

This book is published by The MIT Press under a Creative Commons


Attribution-NonCommercial-ShareAlike 4.0 International License (CC BY-NC-SA). To view a
copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/4.0/.

The text of this book is derived from the book Structure and Interpretation of Computer
Programs, Second Edition, 1996, (SICP) and is subject to a Creative Commons
Attribution-ShareAlike 4.0 International License (CC BY-SA). A comparison edition available
at http://sicp.sourceacademy.org indicates the changes that were made to the text. The figures
are derived from figures created by Andres Raba in 2015 and are also subject to CC BY-SA.
To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/.

The JavaScript programs in this book are derived from the Scheme programs in SICP and are
subject to the GNU General Public License v3.0. To view a copy of this license, visit
https://www.gnu.org/licenses/gpl-3.0.html.

The original image of MIT founder William Barton Rogers in section 2.2.4 is courtesy MIT
Museum.

The cover image is adapted from Le Moyen Age et la Renaissance, Paris, 1848–1851.

This book was set in Times by the authors using the LATEX typesetting system and ancillary
scripts (see https://github.com/source-academy/sicp), and was printed and bound in the United
States of America.

Library of Congress Cataloging-in-Publication Data

Names: Abelson, Harold, author. | Sussman, Gerald Jay, author. | Henz, Martin, adapter. |
Wrigstad, Tobias, adapter. | Sussman, Julie, other.
Title: Structure and interpretation of computer programs / Harold Abelson and Gerald Jay
Sussman; adapted to JavaScript by Martin Henz and Tobias Wrigstad; with Julie Sussman.
Description: Javascript edition. | Cambridge : The MIT Press, [2022] | Series: MIT electrical
engineering and computer science series | Includes bibliographical references and index.
Identifiers: LCCN 2021047249 | ISBN 9780262543231 (paperback)
Subjects: LCSH: Computer programming. | JavaScript (Computer program language)
Classification: LCC QA76.6 .A255 2022 | DDC 005.13–dc23
LC record available at https://lccn.loc.gov/2021047249

10 9 8 7 6 5 4 3 2 1
This book is dedicated, in respect and admiration,
to the spirit that lives in the computer.
“I think it’s extraordinarily important that we in computer science keep fun
in computing. When it started out, it was an awful lot of fun. Of course,
the paying customers got shafted every now and then, and after a while we
began to take their complaints seriously. We began to feel as though we
really were responsible for the successful, error-free, perfect use of these
machines. I don’t think we are. I think we’re responsible for stretching them,
setting them off in new directions, and keeping fun in the house. Fun comes
in many ways. Fun comes in making a discovery, proving a theorem, writing
a program, breaking a code. Whatever form or sense it comes in I hope the
field of computer science never loses its sense of fun. Above all, I hope we
don’t become missionaries. What you know about computing other people
will learn. Don’t feel as though the key to successful computing is only in
your hands. What’s in your hands, I think and hope, is intelligence: the ability
to see the machine as more than when you were first led up to it, that you
can make it more.”
—Alan J. Perlis (April 1, 1922–February 7, 1990)
Contents

Foreword xiii

Foreword to Structure and Interpretation of Computer Programs, 1984 xvii

Preface xxi

Prefaces to Structure and Interpretation of Computer Programs, 1996 & 1984 xxiii

Acknowledgments xxvii

1 Building Abstractions with Functions 1


1.1 The Elements of Programming 3
1.1.1 Expressions 3
1.1.2 Naming and the Environment 5
1.1.3 Evaluating Operator Combinations 6
1.1.4 Compound Functions 8
1.1.5 The Substitution Model for Function Application 11
1.1.6 Conditional Expressions and Predicates 13
1.1.7 Example: Square Roots by Newton’s Method 18
1.1.8 Functions as Black-Box Abstractions 21
1.2 Functions and the Processes They Generate 26
1.2.1 Linear Recursion and Iteration 27
1.2.2 Tree Recursion 32
1.2.3 Orders of Growth 36
1.2.4 Exponentiation 38
1.2.5 Greatest Common Divisors 41
1.2.6 Example: Testing for Primality 43
1.3 Formulating Abstractions with Higher-Order Functions 48
1.3.1 Functions as Arguments 49
1.3.2 Constructing Functions using Lambda Expressions 53
1.3.3 Functions as General Methods 58
1.3.4 Functions as Returned Values 63

2 Building Abstractions with Data 69


2.1 Introduction to Data Abstraction 72
2.1.1 Example: Arithmetic Operations for Rational Numbers 72
2.1.2 Abstraction Barriers 76
2.1.3 What Is Meant by Data? 78
2.1.4 Extended Exercise: Interval Arithmetic 81
x Contents

2.2 Hierarchical Data and the Closure Property 84


2.2.1 Representing Sequences 85
2.2.2 Hierarchical Structures 93
2.2.3 Sequences as Conventional Interfaces 98
2.2.4 Example: A Picture Language 110
2.3 Symbolic Data 124
2.3.1 Strings 124
2.3.2 Example: Symbolic Differentiation 126
2.3.3 Example: Representing Sets 131
2.3.4 Example: Huffman Encoding Trees 140
2.4 Multiple Representations for Abstract Data 148
2.4.1 Representations for Complex Numbers 150
2.4.2 Tagged data 153
2.4.3 Data-Directed Programming and Additivity 157
2.5 Systems with Generic Operations 164
2.5.1 Generic Arithmetic Operations 165
2.5.2 Combining Data of Different Types 170
2.5.3 Example: Symbolic Algebra 177

3 Modularity, Objects, and State 191


3.1 Assignment and Local State 192
3.1.1 Local State Variables 192
3.1.2 The Benefits of Introducing Assignment 199
3.1.3 The Costs of Introducing Assignment 202
3.2 The Environment Model of Evaluation 208
3.2.1 The Rules for Evaluation 209
3.2.2 Applying Simple Functions 212
3.2.3 Frames as the Repository of Local State 215
3.2.4 Internal Declarations 220
3.3 Modeling with Mutable Data 224
3.3.1 Mutable List Structure 224
3.3.2 Representing Queues 233
3.3.3 Representing Tables 237
3.3.4 A Simulator for Digital Circuits 243
3.3.5 Propagation of Constraints 254
3.4 Concurrency: Time Is of the Essence 265
3.4.1 The Nature of Time in Concurrent Systems 266
3.4.2 Mechanisms for Controlling Concurrency 270
3.5 Streams 282
3.5.1 Streams Are Delayed Lists 283
3.5.2 Infinite Streams 290
3.5.3 Exploiting the Stream Paradigm 297
3.5.4 Streams and Delayed Evaluation 307
3.5.5 Modularity of Functional Programs and Modularity of Objects 313
Contents xi

4 Metalinguistic Abstraction 319


4.1 The Metacircular Evaluator 321
4.1.1 The Core of the Evaluator 323
4.1.2 Representing Components 330
4.1.3 Evaluator Data Structures 341
4.1.4 Running the Evaluator as a Program 346
4.1.5 Data as Programs 350
4.1.6 Internal Declarations 353
4.1.7 Separating Syntactic Analysis from Execution 357
4.2 Lazy Evaluation 362
4.2.1 Normal Order and Applicative Order 363
4.2.2 An Interpreter with Lazy Evaluation 364
4.2.3 Streams as Lazy Lists 372
4.3 Nondeterministic Computing 375
4.3.1 Search and amb 376
4.3.2 Examples of Nondeterministic Programs 380
4.3.3 Implementing the amb Evaluator 388
4.4 Logic Programming 400
4.4.1 Deductive Information Retrieval 403
4.4.2 How the Query System Works 413
4.4.3 Is Logic Programming Mathematical Logic? 421
4.4.4 Implementing the Query System 426

5 Computing with Register Machines 451


5.1 Designing Register Machines 452
5.1.1 A Language for Describing Register Machines 454
5.1.2 Abstraction in Machine Design 458
5.1.3 Subroutines 459
5.1.4 Using a Stack to Implement Recursion 464
5.1.5 Instruction Summary 470
5.2 A Register-Machine Simulator 470
5.2.1 The Machine Model 472
5.2.2 The Assembler 476
5.2.3 Instructions and Their Execution Functions 479
5.2.4 Monitoring Machine Performance 486
5.3 Storage Allocation and Garbage Collection 489
5.3.1 Memory as Vectors 490
5.3.2 Maintaining the Illusion of Infinite Memory 495
5.4 The Explicit-Control Evaluator 501
5.4.1 The Dispatcher and Basic Evaluation 502
5.4.2 Evaluating Function Applications 506
5.4.3 Blocks, Assignments, and Declarations 514
5.4.4 Running the Evaluator 515
xii Contents

5.5 Compilation 521


5.5.1 Structure of the Compiler 524
5.5.2 Compiling Components 529
5.5.3 Compiling Applications and Return Statements 537
5.5.4 Combining Instruction Sequences 545
5.5.5 An Example of Compiled Code 548
5.5.6 Lexical Addressing 556
5.5.7 Interfacing Compiled Code to the Evaluator 559

References 567

Index 573

List of Exercises 609


Foreword
I had the pleasure of meeting the amazing Alan Perlis and talking with him a few
times, when I was still a student. He and I had in common a deep love and respect
for two very different programming languages: Lisp and APL. Following in his
footsteps is a daunting task, even though he blazed an excellent trail. Still, I would
like to reexamine one comment he made in the original foreword to this book (and,
please, I suggest that you read his foreword, which immediately follows this one,
before you finish this one). Is it really true that it is better to have 100 functions
operate on one data structure than to have 10 functions operate on 10 data structures?
To answer that question carefully, we first need to ask whether that one data struc-
ture is “universal”: can it conveniently fulfill the roles of those 10 more specialized
data structures?
For that matter, we can also ask: do we really need 100 functions? Is there a
single universal function that can fulfill the roles of all those other functions?
The surprising answer to that last question is “yes”; it is only slightly tricky to
construct a function that accepts (1) a data structure that serves as a description
of some other function, and (2) a list of arguments, and behaves exactly as that
other function would when applied to the given arguments. And it is only slightly
tricky to design a data structure capable of describing any computation whatsoever.
One such data structure (the tagged-list representation of expressions and statements,
paired with environments that associate names with values) and one such universal
function (apply) are described in Chapter 4 of this book. So maybe we need only
one function and one data structure.
That is true in theory. In practice, we find it convenient to draw distinctions that
help us, as human beings constructing descriptions of computations, to organize the
structure of our code so that we can better understand them. I believe that Perlis was
making a remark not about computational capability, but about human abilities and
human limitations.
One thing the human mind seems to do well is to name things; we have powerful
associative memories. Given a name, we can quickly recall some associated thing to
mind. This is why we typically find it easier to work with the lambda calculus than
the combinatory calculus; it is much easier for most people to interpret the Lisp
expression (lambda (x) (lambda (y) (+ x y))) or the JavaScript expression
x => y => x + y than the combinatory expression
((S ((S (K S)) ((S ((S (K S)) ((S (K K)) (K +)))) ((S (K K)) I)))) (K I))
even though there is a direct structural correspondence, easily expressed in five lines
of Lisp code.
So while in principle we could get by with just one universal function, we pre-
fer to modularize our code, to give names to the various pieces, and to mention
the names of function descriptions rather than constantly feeding the descriptions
themselves to the universal function.
xiv Foreword

In my 1998 talk “Growing a Language,” I commented that a good programmer


“does not just write programs. A good programmer builds a working vocabulary.” As
we design and define more and more parts of our programs, we give names to those
parts, and the result is that we have a richer language in which to write the rest.
But we also find it natural to draw distinctions among data structures, and to give
them names.
It may be that nested lists are a universal data structure (and it is worth noting
that many modern and widely used data structures, such as HTML and XML and
JSON, are also parenthetically nested representations, only slightly more elaborate
than Lisp’s bare parentheses). There are also many functions, such as finding the
length of a list or applying a function to every element of a list and getting back a
list of the results, that are useful in a wide variety of situations. And yet, when I am
thinking about a specific computation, I often say to myself, “This list of two things
I expect to be a personal name and a surname, but that list of two things I expect
to be the real and imaginary parts of a complex number, and that other list of two
things I will regard as the numerator and denominator of a fraction.” In other words,
I draw distinctions—and it may be useful to represent those distinctions explicitly in
the data structure, in part to prevent mistakes such as accidentally treating a complex
number as a fraction. (Again, this is a comment about human abilities and human
limitations.)
Since the first edition of this book was written, almost four decades ago, a lot
more ways of organizing data have become relatively standard, in particular the
“object-oriented” approach, and many languages, including JavaScript, support spe-
cialized data structures such as objects and strings and heaps and maps with a variety
of built-in mechanisms and libraries. But in doing so, many languages abandoned
support for more general, universal notions. Java, for example, originally did not sup-
port first-class functions, and has incorporated them only relatively recently, greatly
increasing its expressive power.
APL, likewise, originally did not support first-class functions, and moreover its
original single data structure—arrays of any number of dimensions—was not so
conveniently useful as a universal data structure because arrays could not contain
other arrays as elements. More recent versions of APL do support anonymous
function values and nested arrays, and these have made APL dramatically more
expressive. (The original design of APL did have two very good things going for it:
a comprehensive set of functions applicable to that one data structure, and moreover
an extremely well chosen set of names for those functions. I’m not talking about
the funny symbols and Greek letters, but the spoken words that APL programmers
use when mentioning them, words like shape, reshape, compress, expand, and
laminate; these are names not for the symbols, but for the functions they repre-
sent. Ken Iverson had a real knack for choosing short, memorable, vivid names for
functions on arrays.)
While JavaScript, like Java, was originally designed with objects and methods
in mind, it also incorporated first-class functions from the beginning, and it is not
difficult to use its objects to define a universal data structure. As a result, JavaScript
Foreword xv

is not as distant from Lisp as you would think, and as this edition of Structure and
Interpretation of Computer Programs demonstrates, it is a good alternate framework
for presenting the key ideas. SICP was never about a programming language; it
presents powerful, general ideas for program organization that ought to be useful in
any language.
What do Lisp and JavaScript have in common? The ability to abstract a compu-
tation (code plus some associated data) for later execution as a function; the ability
to embed references to such functions within data structures; the ability to invoke
functions on arguments; the ability to draw a distinction (conditional execution); a
convenient universal data structure; completely automatic storage management for
that data (which seems like a no-brainer, given everything else, until you realize
that many widely used programming languages don’t have it); a large set of useful
functions for operating on that universal data structure; and standard strategies for
using the universal data structure to represent more specialized data structures.
So maybe the truth is somewhere in between the extremes that Perlis so elo-
quently posited. Maybe the sweet spot is something more like 40 functions general
enough to operate usefully on a universal data structure such as lists, but also 10
sets of 6 functions each that are relevant when we take one of 10 specialized views
of that universal data structure. This is manageable if we give good names to these
functions and specialized views.
As you read this book, please pay attention not only to the programming lan-
guage constructs and how they are used, but also to the names given to functions
and variables and data structures. They are not all as short and vivid as the names
Iverson chose for his APL functions, but they have been chosen in a deliberate and
systematic way to enhance your understanding of the overall program structure.
Primitives, means of combination, functional abstraction, naming, and conven-
tions for using a universal data structure in specialized ways by drawing distinctions:
these are the fundamental building blocks of a good programming language. From
there, imagination and good engineering judgment based on experience can do the
rest.

—Guy L. Steele Jr., Lexington, Massachusetts, 2021


Other documents randomly have
different content
PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK

To protect the Project Gutenberg™ mission of promoting the free


distribution of electronic works, by using or distributing this work (or
any other work associated in any way with the phrase “Project
Gutenberg”), you agree to comply with all the terms of the Full
Project Gutenberg™ License available with this file or online at
www.gutenberg.org/license.

Section 1. General Terms of Use and


Redistributing Project Gutenberg™
electronic works
1.A. By reading or using any part of this Project Gutenberg™
electronic work, you indicate that you have read, understand, agree
to and accept all the terms of this license and intellectual property
(trademark/copyright) agreement. If you do not agree to abide by all
the terms of this agreement, you must cease using and return or
destroy all copies of Project Gutenberg™ electronic works in your
possession. If you paid a fee for obtaining a copy of or access to a
Project Gutenberg™ electronic work and you do not agree to be
bound by the terms of this agreement, you may obtain a refund from
the person or entity to whom you paid the fee as set forth in
paragraph 1.E.8.

1.B. “Project Gutenberg” is a registered trademark. It may only be


used on or associated in any way with an electronic work by people
who agree to be bound by the terms of this agreement. There are a
few things that you can do with most Project Gutenberg™ electronic
works even without complying with the full terms of this agreement.
See paragraph 1.C below. There are a lot of things you can do with
Project Gutenberg™ electronic works if you follow the terms of this
agreement and help preserve free future access to Project
Gutenberg™ electronic works. See paragraph 1.E below.
1.C. The Project Gutenberg Literary Archive Foundation (“the
Foundation” or PGLAF), owns a compilation copyright in the
collection of Project Gutenberg™ electronic works. Nearly all the
individual works in the collection are in the public domain in the
United States. If an individual work is unprotected by copyright law in
the United States and you are located in the United States, we do
not claim a right to prevent you from copying, distributing,
performing, displaying or creating derivative works based on the
work as long as all references to Project Gutenberg are removed. Of
course, we hope that you will support the Project Gutenberg™
mission of promoting free access to electronic works by freely
sharing Project Gutenberg™ works in compliance with the terms of
this agreement for keeping the Project Gutenberg™ name
associated with the work. You can easily comply with the terms of
this agreement by keeping this work in the same format with its
attached full Project Gutenberg™ License when you share it without
charge with others.

1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside the
United States, check the laws of your country in addition to the terms
of this agreement before downloading, copying, displaying,
performing, distributing or creating derivative works based on this
work or any other Project Gutenberg™ work. The Foundation makes
no representations concerning the copyright status of any work in
any country other than the United States.

1.E. Unless you have removed all references to Project Gutenberg:

1.E.1. The following sentence, with active links to, or other


immediate access to, the full Project Gutenberg™ License must
appear prominently whenever any copy of a Project Gutenberg™
work (any work on which the phrase “Project Gutenberg” appears, or
with which the phrase “Project Gutenberg” is associated) is
accessed, displayed, performed, viewed, copied or distributed:
This eBook is for the use of anyone anywhere in the United
States and most other parts of the world at no cost and with
almost no restrictions whatsoever. You may copy it, give it away
or re-use it under the terms of the Project Gutenberg License
included with this eBook or online at www.gutenberg.org. If you
are not located in the United States, you will have to check the
laws of the country where you are located before using this
eBook.

1.E.2. If an individual Project Gutenberg™ electronic work is derived


from texts not protected by U.S. copyright law (does not contain a
notice indicating that it is posted with permission of the copyright
holder), the work can be copied and distributed to anyone in the
United States without paying any fees or charges. If you are
redistributing or providing access to a work with the phrase “Project
Gutenberg” associated with or appearing on the work, you must
comply either with the requirements of paragraphs 1.E.1 through
1.E.7 or obtain permission for the use of the work and the Project
Gutenberg™ trademark as set forth in paragraphs 1.E.8 or 1.E.9.

1.E.3. If an individual Project Gutenberg™ electronic work is posted


with the permission of the copyright holder, your use and distribution
must comply with both paragraphs 1.E.1 through 1.E.7 and any
additional terms imposed by the copyright holder. Additional terms
will be linked to the Project Gutenberg™ License for all works posted
with the permission of the copyright holder found at the beginning of
this work.

1.E.4. Do not unlink or detach or remove the full Project


Gutenberg™ License terms from this work, or any files containing a
part of this work or any other work associated with Project
Gutenberg™.

1.E.5. Do not copy, display, perform, distribute or redistribute this


electronic work, or any part of this electronic work, without
prominently displaying the sentence set forth in paragraph 1.E.1 with
active links or immediate access to the full terms of the Project
Gutenberg™ License.
1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if you
provide access to or distribute copies of a Project Gutenberg™ work
in a format other than “Plain Vanilla ASCII” or other format used in
the official version posted on the official Project Gutenberg™ website
(www.gutenberg.org), you must, at no additional cost, fee or expense
to the user, provide a copy, a means of exporting a copy, or a means
of obtaining a copy upon request, of the work in its original “Plain
Vanilla ASCII” or other form. Any alternate format must include the
full Project Gutenberg™ License as specified in paragraph 1.E.1.

1.E.7. Do not charge a fee for access to, viewing, displaying,


performing, copying or distributing any Project Gutenberg™ works
unless you comply with paragraph 1.E.8 or 1.E.9.

1.E.8. You may charge a reasonable fee for copies of or providing


access to or distributing Project Gutenberg™ electronic works
provided that:

• You pay a royalty fee of 20% of the gross profits you derive from
the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”

• You provide a full refund of any money paid by a user who


notifies you in writing (or by e-mail) within 30 days of receipt that
s/he does not agree to the terms of the full Project Gutenberg™
License. You must require such a user to return or destroy all
copies of the works possessed in a physical medium and
discontinue all use of and all access to other copies of Project
Gutenberg™ works.

• You provide, in accordance with paragraph 1.F.3, a full refund of


any money paid for a work or a replacement copy, if a defect in
the electronic work is discovered and reported to you within 90
days of receipt of the work.

• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.

1.E.9. If you wish to charge a fee or distribute a Project Gutenberg™


electronic work or group of works on different terms than are set
forth in this agreement, you must obtain permission in writing from
the Project Gutenberg Literary Archive Foundation, the manager of
the Project Gutenberg™ trademark. Contact the Foundation as set
forth in Section 3 below.

1.F.

1.F.1. Project Gutenberg volunteers and employees expend


considerable effort to identify, do copyright research on, transcribe
and proofread works not protected by U.S. copyright law in creating
the Project Gutenberg™ collection. Despite these efforts, Project
Gutenberg™ electronic works, and the medium on which they may
be stored, may contain “Defects,” such as, but not limited to,
incomplete, inaccurate or corrupt data, transcription errors, a
copyright or other intellectual property infringement, a defective or
damaged disk or other medium, a computer virus, or computer
codes that damage or cannot be read by your equipment.

1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES - Except


for the “Right of Replacement or Refund” described in paragraph
1.F.3, the Project Gutenberg Literary Archive Foundation, the owner
of the Project Gutenberg™ trademark, and any other party
distributing a Project Gutenberg™ electronic work under this
agreement, disclaim all liability to you for damages, costs and
expenses, including legal fees. YOU AGREE THAT YOU HAVE NO
REMEDIES FOR NEGLIGENCE, STRICT LIABILITY, BREACH OF
WARRANTY OR BREACH OF CONTRACT EXCEPT THOSE
PROVIDED IN PARAGRAPH 1.F.3. YOU AGREE THAT THE
FOUNDATION, THE TRADEMARK OWNER, AND ANY
DISTRIBUTOR UNDER THIS AGREEMENT WILL NOT BE LIABLE
TO YOU FOR ACTUAL, DIRECT, INDIRECT, CONSEQUENTIAL,
PUNITIVE OR INCIDENTAL DAMAGES EVEN IF YOU GIVE
NOTICE OF THE POSSIBILITY OF SUCH DAMAGE.

1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND - If you


discover a defect in this electronic work within 90 days of receiving it,
you can receive a refund of the money (if any) you paid for it by
sending a written explanation to the person you received the work
from. If you received the work on a physical medium, you must
return the medium with your written explanation. The person or entity
that provided you with the defective work may elect to provide a
replacement copy in lieu of a refund. If you received the work
electronically, the person or entity providing it to you may choose to
give you a second opportunity to receive the work electronically in
lieu of a refund. If the second copy is also defective, you may
demand a refund in writing without further opportunities to fix the
problem.

1.F.4. Except for the limited right of replacement or refund set forth in
paragraph 1.F.3, this work is provided to you ‘AS-IS’, WITH NO
OTHER WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR ANY PURPOSE.

1.F.5. Some states do not allow disclaimers of certain implied


warranties or the exclusion or limitation of certain types of damages.
If any disclaimer or limitation set forth in this agreement violates the
law of the state applicable to this agreement, the agreement shall be
interpreted to make the maximum disclaimer or limitation permitted
by the applicable state law. The invalidity or unenforceability of any
provision of this agreement shall not void the remaining provisions.
1.F.6. INDEMNITY - You agree to indemnify and hold the
Foundation, the trademark owner, any agent or employee of the
Foundation, anyone providing copies of Project Gutenberg™
electronic works in accordance with this agreement, and any
volunteers associated with the production, promotion and distribution
of Project Gutenberg™ electronic works, harmless from all liability,
costs and expenses, including legal fees, that arise directly or
indirectly from any of the following which you do or cause to occur:
(a) distribution of this or any Project Gutenberg™ work, (b)
alteration, modification, or additions or deletions to any Project
Gutenberg™ work, and (c) any Defect you cause.

Section 2. Information about the Mission of


Project Gutenberg™
Project Gutenberg™ is synonymous with the free distribution of
electronic works in formats readable by the widest variety of
computers including obsolete, old, middle-aged and new computers.
It exists because of the efforts of hundreds of volunteers and
donations from people in all walks of life.

Volunteers and financial support to provide volunteers with the


assistance they need are critical to reaching Project Gutenberg™’s
goals and ensuring that the Project Gutenberg™ collection will
remain freely available for generations to come. In 2001, the Project
Gutenberg Literary Archive Foundation was created to provide a
secure and permanent future for Project Gutenberg™ and future
generations. To learn more about the Project Gutenberg Literary
Archive Foundation and how your efforts and donations can help,
see Sections 3 and 4 and the Foundation information page at
www.gutenberg.org.

Section 3. Information about the Project


Gutenberg Literary Archive Foundation
The Project Gutenberg Literary Archive Foundation is a non-profit
501(c)(3) educational corporation organized under the laws of the
state of Mississippi and granted tax exempt status by the Internal
Revenue Service. The Foundation’s EIN or federal tax identification
number is 64-6221541. Contributions to the Project Gutenberg
Literary Archive Foundation are tax deductible to the full extent
permitted by U.S. federal laws and your state’s laws.

The Foundation’s business office is located at 809 North 1500 West,


Salt Lake City, UT 84116, (801) 596-1887. Email contact links and up
to date contact information can be found at the Foundation’s website
and official page at www.gutenberg.org/contact

Section 4. Information about Donations to


the Project Gutenberg Literary Archive
Foundation
Project Gutenberg™ depends upon and cannot survive without
widespread public support and donations to carry out its mission of
increasing the number of public domain and licensed works that can
be freely distributed in machine-readable form accessible by the
widest array of equipment including outdated equipment. Many small
donations ($1 to $5,000) are particularly important to maintaining tax
exempt status with the IRS.

The Foundation is committed to complying with the laws regulating


charities and charitable donations in all 50 states of the United
States. Compliance requirements are not uniform and it takes a
considerable effort, much paperwork and many fees to meet and
keep up with these requirements. We do not solicit donations in
locations where we have not received written confirmation of
compliance. To SEND DONATIONS or determine the status of
compliance for any particular state visit www.gutenberg.org/donate.

While we cannot and do not solicit contributions from states where


we have not met the solicitation requirements, we know of no
prohibition against accepting unsolicited donations from donors in
such states who approach us with offers to donate.

International donations are gratefully accepted, but we cannot make


any statements concerning tax treatment of donations received from
outside the United States. U.S. laws alone swamp our small staff.

Please check the Project Gutenberg web pages for current donation
methods and addresses. Donations are accepted in a number of
other ways including checks, online payments and credit card
donations. To donate, please visit: www.gutenberg.org/donate.

Section 5. General Information About Project


Gutenberg™ electronic works
Professor Michael S. Hart was the originator of the Project
Gutenberg™ concept of a library of electronic works that could be
freely shared with anyone. For forty years, he produced and
distributed Project Gutenberg™ eBooks with only a loose network of
volunteer support.

Project Gutenberg™ eBooks are often created from several printed


editions, all of which are confirmed as not protected by copyright in
the U.S. unless a copyright notice is included. Thus, we do not
necessarily keep eBooks in compliance with any particular paper
edition.

Most people start at our website which has the main PG search
facility: www.gutenberg.org.

This website includes information about Project Gutenberg™,


including how to make donations to the Project Gutenberg Literary
Archive Foundation, how to help produce our new eBooks, and how
to subscribe to our email newsletter to hear about new eBooks.
back
back
back
back
back
back
back
back
back

You might also like