Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Html5 #72

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
f52a391
These sentences about average damping were repeated needlessly.
Iain-S Mar 29, 2019
62734e1
From the W3C html validator: Error - Self-closing syntax (/>) used on…
Iain-S Mar 29, 2019
c36c84a
I'm not sure whether the links are meant to be auto generated with th…
Iain-S Mar 29, 2019
8377bb8
Fixed the remaining @ref link.
Iain-S Mar 29, 2019
58dc4d4
Adding some 'best practice' xhtml attributes.
Iain-S Mar 29, 2019
28d30a0
Added render_all.py, which required some changes to render.py. rende…
Iain-S Mar 31, 2019
327a3ee
Commenting out the google analytics for now. Adding some pycharm fol…
Iain-S Mar 31, 2019
bc2ff28
Removed xml licence attributes as they are not allowed in html5.
Iain-S Mar 31, 2019
82d2cc6
Auto-formatted the template (four spaces for indents).
Iain-S Mar 31, 2019
e9f3fe2
Formatting and closing </p> tags.
Iain-S Mar 31, 2019
eb09591
Removing closing </p> tags as it works fine without them.
Iain-S Mar 31, 2019
bd4ad3a
Addressed all W3C validator errors.
Iain-S Mar 31, 2019
20e9b21
There are no errors or warnings for 1-1 now.
Iain-S Mar 31, 2019
92c0a87
The mathjax cdn is to be discontinued and they recommend using cloudf…
Iain-S Mar 31, 2019
5a24e62
Making changes to validated html5.
Iain-S Apr 1, 2019
2cfa0b5
Adding a unique id for each exercise.
Iain-S Apr 1, 2019
b190cb7
Making changes to validated html5.
Iain-S Apr 1, 2019
dc87ac8
Making changes to validated html5.
Iain-S Apr 1, 2019
188c1fd
Making changes to validated html5.
Iain-S Apr 1, 2019
22a4392
Print histogram of errors.
Iain-S Apr 1, 2019
cf5d9ac
Making chapter 4 html5 compliant.
Iain-S Apr 1, 2019
a7ee135
Making section 5-1 html5 compliant.
Iain-S Apr 1, 2019
299b4f9
Making section 5-1 html5 compliant.
Iain-S Apr 1, 2019
db9b36f
Making 5-3, 5-4 and 5-5 html5 compliant.
Iain-S Apr 1, 2019
cb5444a
Switched name= for id=.
Iain-S Apr 1, 2019
01f66dd
Merging change from mobile branch.
Iain-S Apr 3, 2019
e1636be
The spaces between the image and a tags were rendered as some kind of…
Iain-S Apr 3, 2019
c19cc5c
Adding functional tests and fixing JS errors.
Iain-S Apr 15, 2019
76c5f42
Merge branch 'master' into html5
Iain-S Apr 15, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
# python specific
*.pyc
__pycache__
.idea/
venv/

## generic files to ignore
# generic files to ignore
*~
*.lock
*.DS_Store
*.swp
*.out
*/Thumbs.db

# generated html files
[0-9]*.html

coding-js
15 changes: 8 additions & 7 deletions content/1-0-abstractions.content.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@
@@

{{main_text}}
<a href='index.html' style="float:left"> <img src='images/chevron-up.svg' height=64 width=64> </a>
<a href='index.html' style="float:left"><img src='images/chevron-up.svg' height=64 width=64 alt="up chevron"></a>
<span style="float:right">
<a href='1-1-elements.html'> <img src='images/chevron-right.svg' height=64 width=64> </a>
<a href='1-1-elements.html'><img src='images/chevron-right.svg' height=64 width=64 alt="right chevron"> </a>
</span>
<br> <br>
<h2> Building Abstractions with Procedures </h2>

<hr>

<blockquote style="font-size:0.8em;">The acts of the mind, wherein it exerts its power over simple ideas, are chiefly these three: 1. Combining several simple ideas into one compound one, and thus all complex ideas are made. 2. The second is bringing two ideas, whether simple or complex, together, and setting them by one another so as to take a view of them at once, without uniting them into one, by which it gets all its ideas of relations. 3. The third is separating them from all other ideas that accompany them in their real existence: this is called abstraction, and thus all its general ideas are made.
<blockquote style="font-size:0.8em;">
The acts of the mind, wherein it exerts its power over simple ideas, are chiefly these three: 1. Combining several simple ideas into one compound one, and thus all complex ideas are made. 2. The second is bringing two ideas, whether simple or complex, together, and setting them by one another so as to take a view of them at once, without uniting them into one, by which it gets all its ideas of relations. 3. The third is separating them from all other ideas that accompany them in their real existence: this is called abstraction, and thus all its general ideas are made.

<p> John Locke, An Essay Concerning Human Understanding (1690)
<p> John Locke, An Essay Concerning Human Understanding (1690)
</blockquote>

<p> We are about to study the idea of a computational process. Computational processes are abstract beings that inhabit computers. As they evolve, processes manipulate other abstract things called data. The evolution of a process is directed by a pattern of rules called a program. People create programs to direct processes. In effect, we conjure the spirits of the computer with our spells.
Expand All @@ -31,11 +32,11 @@ <h4> Programming in Lisp </h4>

<p> We need an appropriate language for describing processes, and we will use for this purpose the programming language Lisp. Just as our everyday thoughts are usually expressed in our natural language (such as English, French, or Japanese), and descriptions of quantitative phenomena are expressed with mathematical notations, our procedural thoughts will be expressed in Lisp. Lisp was invented in the late 1950s as a formalism for reasoning about the use of certain kinds of logical expressions, called recursion equations, as a model for computation. The language was conceived by John McCarthy and is based on his paper "Recursive Functions of Symbolic Expressions and Their Computation by Machine" (McCarthy 1960).

<p> Despite its inception as a mathematical formalism, Lisp is a practical programming language. A Lisp interpreter is a machine that carries out processes described in the Lisp language. The first Lisp interpreter was implemented by McCarthy with the help of colleagues and students in the Artificial Intelligence Group of the MIT Research Laboratory of Electronics and in the MIT Computation Center.<a name="footnote_link_1-1" class="footnote_link" href="#footnote_1-1">1</a> Lisp, whose name is an acronym for LISt Processing, was designed to provide symbol-manipulating capabilities for attacking programming problems such as the symbolic differentiation and integration of algebraic expressions. It included for this purpose new data objects known as atoms and lists, which most strikingly set it apart from all other languages of the period.
<p> Despite its inception as a mathematical formalism, Lisp is a practical programming language. A Lisp interpreter is a machine that carries out processes described in the Lisp language. The first Lisp interpreter was implemented by McCarthy with the help of colleagues and students in the Artificial Intelligence Group of the MIT Research Laboratory of Electronics and in the MIT Computation Center.<a id="footnote_link_1-1" class="footnote_link" href="#footnote_1-1">1</a> Lisp, whose name is an acronym for LISt Processing, was designed to provide symbol-manipulating capabilities for attacking programming problems such as the symbolic differentiation and integration of algebraic expressions. It included for this purpose new data objects known as atoms and lists, which most strikingly set it apart from all other languages of the period.

<p> Lisp was not the product of a concerted design effort. Instead, it evolved informally in an experimental manner in response to users' needs and to pragmatic implementation considerations. Lisp's informal evolution has continued through the years, and the community of Lisp users has traditionally resisted attempts to promulgate any ``official'' definition of the language. This evolution, together with the flexibility and elegance of the initial conception, has enabled Lisp, which is the second oldest language in widespread use today (only Fortran is older), to continually adapt to encompass the most modern ideas about program design. Thus, Lisp is by now a family of dialects, which, while sharing most of the original features, may differ from one another in significant ways. The dialect of Lisp used in this book is called Scheme.<a name="footnote_link_1-2" class="footnote_link" href="#footnote_1-2">2</a>
<p> Lisp was not the product of a concerted design effort. Instead, it evolved informally in an experimental manner in response to users' needs and to pragmatic implementation considerations. Lisp's informal evolution has continued through the years, and the community of Lisp users has traditionally resisted attempts to promulgate any ``official'' definition of the language. This evolution, together with the flexibility and elegance of the initial conception, has enabled Lisp, which is the second oldest language in widespread use today (only Fortran is older), to continually adapt to encompass the most modern ideas about program design. Thus, Lisp is by now a family of dialects, which, while sharing most of the original features, may differ from one another in significant ways. The dialect of Lisp used in this book is called Scheme.<a id="footnote_link_1-2" class="footnote_link" href="#footnote_1-2">2</a>

<p> Because of its experimental character and its emphasis on symbol manipulation, Lisp was at first very inefficient for numerical computations, at least in comparison with Fortran. Over the years, however, Lisp compilers have been developed that translate programs into machine code that can perform numerical computations reasonably efficiently. And for special applications, Lisp has been used with great effectiveness.<a name="footnote_link_1-3" class="footnote_link" href="#footnote_1-3">3</a> Although Lisp has not yet overcome its old reputation as hopelessly inefficient, Lisp is now used in many applications where efficiency is not the central concern. For example, Lisp has become a language of choice for operating-system shell languages and for extension languages for editors and computer-aided design systems.
<p> Because of its experimental character and its emphasis on symbol manipulation, Lisp was at first very inefficient for numerical computations, at least in comparison with Fortran. Over the years, however, Lisp compilers have been developed that translate programs into machine code that can perform numerical computations reasonably efficiently. And for special applications, Lisp has been used with great effectiveness.<a id="footnote_link_1-3" class="footnote_link" href="#footnote_1-3">3</a> Although Lisp has not yet overcome its old reputation as hopelessly inefficient, Lisp is now used in many applications where efficiency is not the central concern. For example, Lisp has become a language of choice for operating-system shell languages and for extension languages for editors and computer-aided design systems.

<p> If Lisp is not a mainstream language, why are we using it as the framework for our discussion of programming? Because the language possesses unique features that make it an excellent medium for studying important programming constructs and data structures and for relating them to the linguistic features that support them. The most significant of these features is the fact that Lisp descriptions of processes, called procedures, can themselves be represented and manipulated as Lisp data. The importance of this is that there are powerful program-design techniques that rely on the ability to blur the traditional distinction between ``passive'' data and ``active'' processes. As we shall discover, Lisp's flexibility in handling procedures as data makes it one of the most convenient languages in existence for exploring these techniques. The ability to represent procedures as data also makes Lisp an excellent language for writing programs that must manipulate other programs as data, such as the interpreters and compilers that support computer languages. Above and beyond these considerations, programming in Lisp is great fun.

Expand Down
Loading