From 069fe15452aa33440aff5e770c169bd3612d7646 Mon Sep 17 00:00:00 2001
From: Derek Brown
$ cd @@ -376,7 +376,7 @@ $ chmod 400 .erlang.cookieErlang systems, you must give it a name, eg:
$ erl -sname my_name-
We will see more details of this later (*manual*). If you want to +
We will see more details of this later. If you want to
experiment with distributed Erlang, but you only have one
computer to work on, you can start two separate Erlang systems on
the same computer but give them different names. Each Erlang
@@ -385,7 +385,7 @@ $ erl -sname my_name
IP domain and we can use only the first component of the IP
address, if we want to use nodes in different domains we use
Here is the ping pong example modified to run on two separate nodes:
@@ -538,9 +538,9 @@ ping finished
Before we start, let's note the following:
-
-
This example will just show the message passing logic no
+
This example will just show the message passing logic- no
attempt at all has been made to provide a nice graphical user
- interface - this can of course also be done in Erlang - but
+ interface. This can, of course, also be done in Erlang - but
that's another tutorial.
-
@@ -550,8 +550,8 @@ ping finished
tutorial.
-
-
The first program we write will contain some inadequacies as
- regards handling of nodes which disappear, we will correct
+
The first program we write will contain some inadequacies
+ regarding the handling of nodes which disappear. We will correct
these in a later version of the program.
@@ -734,11 +734,11 @@ await_result() ->
- copy the compiled code (
messenger.beam ) to
the directory on each computer where you start Erlang.
- In the following example of use of this program, I have started
+
In the following example of use of this program I have started
nodes on four different computers, but if you don't have that
- many machines available on your network, you could start up
+ many machines available on your network you could start up
several nodes on the same machine.
- We start up four Erlang nodes, messenger@super, c1@bilbo,
+
We start up four Erlang nodes: messenger@super, c1@bilbo,
c2@kosken, c3@gollum.
First we start up a the server at messenger@super:
@@ -780,19 +780,19 @@ ok
receiver_not_found
But this fails as Fred has already logged off.
First let's look at some of the new concepts we have introduced.
- There are two versions of the server_transfer function,
+
There are two versions of the server_transfer function:
one with four arguments (server_transfer/4 ) and one with
five (server_transfer/5 ). These are regarded by Erlang as
two separate functions.
Note how we write the server function so that it calls
- itself, server(User_List) and thus creates a loop.
+ itself, via server(User_List) , and thus creates a loop.
The Erlang compiler is "clever" and optimizes the code so that
this really is a sort of loop and not a proper function call. But
this only works if there is no code after the call, otherwise
the compiler will expect the call to return and make a proper
function call. This would result in the process getting bigger
and bigger for every loop.
- We use functions in the lists module. This is a very
+
We use functions from the lists module. This is a very
useful module and a study of the manual page is recommended
(erl -man lists ).
lists:keymember(Key,Position,Lists) looks through a list
diff --git a/system/doc/getting_started/seq_prog.xml b/system/doc/getting_started/seq_prog.xml
index fd49102263..be43e8d896 100644
--- a/system/doc/getting_started/seq_prog.xml
+++ b/system/doc/getting_started/seq_prog.xml
@@ -31,14 +31,14 @@
The Erlang Shell
- Most operating systems have a command interpreter or shell, Unix
- and Linux have many, Windows has the Command Prompt. Erlang has
+
Most operating systems have a command interpreter or shell- Unix
+ and Linux have many, while Windows has the Command Prompt. Erlang has
its own shell where you can directly write bits of Erlang code
and evaluate (run) them to see what happens (see
shell(3) ). Start
the Erlang shell (in Linux or UNIX) by starting a shell or
command interpreter in your operating system and typing
- erl , you will see something like this.
+ erl . You will see something like this.
% erl
Erlang R15B (erts-5.9.1) [source] [smp:8:8] [rq:8] [async-threads:0] [hipe] [kernel-poll:false]
@@ -481,7 +481,7 @@ blue(#{blue := SV, alpha := SA}, #{blue := DV, alpha := DA}) ->
> color:blend(C2,C1).
#{alpha => 1.0,blue => 0.38,green => 0.52,red => 0.51}
- This example warrant some explanation:
+ This example warrants some explanation:
-define(is_channel(V), (is_float(V) andalso V >= 0.0 andalso V =< 1.0)).
@@ -1152,13 +1152,13 @@ month_length(Year, Month) ->
Built In Functions (BIFs)
- Built in functions BIFs are functions which for some reason is
+
Built in functions (BIFs) are functions which for some reason are
built in to the Erlang virtual machine. BIFs often implement
functionality that is impossible to implement in Erlang or is too
inefficient to implement in Erlang. Some BIFs can be called
- by use of the function name only but they are by default belonging
- to the erlang module so for example the call to the BIF trunc
- below is equivalent with a call to erlang:trunc .
+ by use of the function name only, but they by default belong
+ to the erlang module. So for example, the call to the BIF trunc
+ below is equivalent to a call to erlang:trunc .
As you can see, we first find out if a year is leap or not. If a
year is divisible by 400, it is a leap year. To find this out we
first divide the year by 400 and use the built in function
@@ -1175,14 +1175,14 @@ trunc(5.01) = 5
2000 / 400 = 5.0
trunc(5.0) = 5
5 * 400 = 2000
- so we have a leap year. The next two tests if the year is
- divisible by 100 or 4 are done in the same way. The first
-
so we have a leap year. The next two tests, which check if the year is
+ divisible by 100 or 4, are done in the same way. The first
+
This example showed the use of
This example showed the use of
74> 2004 rem 400. -- cgit v1.2.3