A powerful programming language is more than just a means for
instructing a computer to perform tasks. The language also serves as
a framework within which we organize our ideas about processes. Thus,
when we describe a language, we should pay particular attention to the
means that the language provides for combining simple ideas to form
more complex ideas. Every powerful language has three mechanisms for
accomplishing this:
-
primitive expressions,
which represent the simplest
entities the language is concerned with,
-
means of combination, by
which compound elements are built from simpler ones, and
-
means of abstraction,
by which compound elements can be named and manipulated as units.
強力なプログラミング言語は、コンピュータにタスクを実行させるための手段にとどまりません。言語はまた、プロセスについてのアイデアを整理するためのフレームワークとしても機能します。したがって、言語を説明するときは、単純なアイデアを組み合わせてより複雑なアイデアを形成するために言語が提供する手段に特に注意を払うべきです。すべての強力な言語には、これを実現するための3つのメカニズムがあります:
-
プリミティブな式——
言語が扱う最も単純な要素を表すもの、
-
組み合わせの手段——
より単純な要素から複合的な要素を構築するもの、
-
抽象化の手段——
複合的な要素に名前を付けて、一つの単位として操作できるようにするもの。
In programming, we deal with two kinds of elements:
functions
and
data. (Later we will discover that they are really not so distinct.)
Informally, data is stuff
that we want to manipulate, and
functions
are descriptions of the rules for manipulating the data.
Thus, any powerful programming language should be able to describe
primitive data and primitive
functions
and should have methods for
combining and abstracting
functions
and data.
プログラミングでは、2種類の要素を扱います:
関数
と
データです。(後に、これらは実はそれほど区別がないことがわかります。)
大まかに言えば、データとは操作したいもの
であり、
関数
はデータを操作するルールの記述です。
したがって、強力なプログラミング言語は、プリミティブなデータとプリミティブな
関数
を記述でき、
関数
とデータを組み合わせたり抽象化したりする方法を備えている必要があります。
In this chapter we will deal only with simple
numerical data so that
we can focus on the rules for building
functions.
この章では、
関数を構築するルールに集中できるように、単純な数値データのみを扱います。
In later chapters we will see that
these same rules allow us to build
functions
to manipulate compound data as well.
後の章では、これらと同じルールによって、複合データを操作する
関数
も構築できることを見ていきます。
1.1
The Elements of Programming
プログラミングの要素