1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
|
<?xml version="1.0" encoding="latin1" ?>
<!DOCTYPE chapter SYSTEM "chapter.dtd">
<chapter>
<header>
<copyright>
<year>2003</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
The contents of this file are subject to the Erlang Public License,
Version 1.1, (the "License"); you may not use this file except in
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at http://www.erlang.org/.
Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limitations
under the License.
</legalnotice>
<title>Introduction</title>
<prepared></prepared>
<docno></docno>
<date></date>
<rev></rev>
<file>introduction.xml</file>
</header>
<section>
<title>Purpose</title>
<p>This reference manual describes the Erlang programming
language. The focus is on the language itself, not
the implementation. The language constructs are described in
text and with examples rather than formally specified, with
the intention to make the manual more readable.
The manual is not intended as a tutorial.</p>
<p>Information about this implementation of Erlang can be found, for
example, in <em>System Principles</em> (starting and stopping,
boot scripts, code loading, error logging, creating target
systems), <em>Efficiency Guide</em> (memory consumption, system
limits) and <em>ERTS User's Guide</em> (crash dumps, drivers).</p>
</section>
<section>
<title>Prerequisites</title>
<p>It is assumed that the reader has done some programming and
is familiar with concepts such as data types and programming
language syntax.</p>
</section>
<section>
<title>Document Conventions</title>
<p>In the document, the following terminology is used:</p>
<list type="bulleted">
<item>A <em>sequence</em> is one or more items. For example, a
clause body consists of a sequence of expressions. This
means that there must be at least one expression.</item>
<item>A <em>list</em> is any number of items. For example,
an argument list can consist of zero, one or more arguments.</item>
</list>
<p>If a feature has been added recently, in Erlang 5.0/OTP R7 or
later, this is mentioned in the text.</p>
</section>
<section>
<title>Complete List of BIFs</title>
<p>For a complete list of BIFs, their arguments and return values,
refer to <c>erlang(3)</c>.</p>
</section>
<section>
<title>Reserved Words</title>
<p>The following are reserved words in Erlang:</p>
<p>after and andalso band begin bnot bor bsl bsr bxor case catch
cond div end fun if let not of or orelse query receive rem try
when xor</p>
</section>
<section>
<title>Character Set</title>
<p>In Erlang 4.8/OTP R5A the syntax of Erlang tokens was extended to
allow the use of the full ISO-8859-1 (Latin-1) character set. This
is noticeable in the following ways:</p>
<list type="bulleted">
<item>
<p>All the Latin-1 printable characters can be used and are
shown without the escape backslash convention.</p>
</item>
<item>
<p>Atoms and variables can use all Latin-1 letters.</p>
</item>
</list>
<table>
<row>
<cell align="left" valign="middle"><em>Octal</em></cell>
<cell align="left" valign="middle"><em>Decimal</em></cell>
<cell align="left" valign="middle"> </cell>
<cell align="left" valign="middle"><em>Class</em></cell>
</row>
<row>
<cell align="left" valign="middle">200 - 237</cell>
<cell align="left" valign="middle">128 - 159</cell>
<cell align="left" valign="middle"> </cell>
<cell align="left" valign="middle">Control characters</cell>
</row>
<row>
<cell align="left" valign="middle">240 - 277</cell>
<cell align="left" valign="middle">160 - 191</cell>
<cell align="right" valign="middle">- ¿</cell>
<cell align="left" valign="middle">Punctuation characters</cell>
</row>
<row>
<cell align="left" valign="middle">300 - 326</cell>
<cell align="left" valign="middle">192 - 214</cell>
<cell align="center" valign="middle">À - Ö</cell>
<cell align="left" valign="middle">Uppercase letters</cell>
</row>
<row>
<cell align="center" valign="middle">327</cell>
<cell align="center" valign="middle">215</cell>
<cell align="center" valign="middle">×</cell>
<cell align="left" valign="middle">Punctuation character</cell>
</row>
<row>
<cell align="left" valign="middle">330 - 336</cell>
<cell align="left" valign="middle">216 - 222</cell>
<cell align="center" valign="middle">Ø - Þ</cell>
<cell align="left" valign="middle">Uppercase letters</cell>
</row>
<row>
<cell align="left" valign="middle">337 - 366</cell>
<cell align="left" valign="middle">223 - 246</cell>
<cell align="center" valign="middle">ß - ö</cell>
<cell align="left" valign="middle">Lowercase letters</cell>
</row>
<row>
<cell align="center" valign="middle">367</cell>
<cell align="center" valign="middle">247</cell>
<cell align="center" valign="middle">÷</cell>
<cell align="left" valign="middle">Punctuation character</cell>
</row>
<row>
<cell align="left" valign="middle">370 - 377</cell>
<cell align="left" valign="middle">248 - 255</cell>
<cell align="center" valign="middle">ø - ÿ</cell>
<cell align="left" valign="middle">Lowercase letters</cell>
</row>
<tcaption>Character Classes.</tcaption>
</table>
<p>In Erlang/OTP R16 the syntax of Erlang tokens was extended to
handle Unicode. To begin with the support is limited to strings,
but Erlang/OTP R18 is expected to handle Unicode atoms as well.
More about the usage of Unicode in Erlang source files can be
found in <seealso
marker="stdlib:unicode_usage#unicode_in_erlang">STDLIB's User'S
Guide</seealso>. The default encoding for Erlang source files
is still Latin-1, but in Erlang/OTP R17 the default encoding
will be UTF-8. The details on how to state the encoding of an
Erlang source file can be found in <seealso
marker="stdlib:epp#encoding">epp(3)</seealso>.</p>
</section>
</chapter>
|