File 0261-Fix-typos-in-Getting-Started.patch of Package erlang

From 80ca84a3e6e356473cdb6d63630439565c0b38c8 Mon Sep 17 00:00:00 2001
From: Jan Uhlig <juhlig@hnc-agency.org>
Date: Tue, 17 Mar 2026 12:20:50 +0100
Subject: [PATCH] Fix typos in Getting Started

Co-authored-by: Maria Scott <maria-12648430@hnc-agency.org>
---
 system/doc/getting_started/conc_prog.md      |  67 ++++++------
 system/doc/getting_started/records_macros.md |  32 +++---
 system/doc/getting_started/robustness.md     |  22 ++--
 system/doc/getting_started/seq_prog.md       | 102 ++++++++++---------
 4 files changed, 111 insertions(+), 112 deletions(-)

diff --git a/system/doc/getting_started/conc_prog.md b/system/doc/getting_started/conc_prog.md
index 449a74fdac..e3f85777cd 100644
--- a/system/doc/getting_started/conc_prog.md
+++ b/system/doc/getting_started/conc_prog.md
@@ -71,7 +71,7 @@ done
 ```
 
 As shown, the function `say_something` writes its first argument the number of
-times specified by second argument. The function `start` starts two Erlang
+times specified by the second argument. The function `start` starts two Erlang
 processes, one that writes "hello" three times and one that writes "goodbye"
 three times. Both processes use the function `say_something`. Notice that a
 function used in this way by `spawn`, to start a process, must be exported from
@@ -149,7 +149,7 @@ start() ->
 ```erlang
 1> c(tut15).
 {ok,tut15}
-2> tut15: start().
+2> tut15:start().
 <0.36.0>
 Pong received ping
 Ping received pong
@@ -205,7 +205,7 @@ receive
    pattern2 ->
        actions2;
    ....
-   patternN
+   patternN ->
        actionsN
 end.
 ```
@@ -254,7 +254,7 @@ process "ping":
 Ping_PID ! pong
 ```
 
-Notice how the operator "\!" is used to send messages. The syntax of "\!" is:
+Notice how the operator `!` is used to send messages. The syntax of `!` is:
 
 ```erlang
 Pid ! Message
@@ -283,7 +283,7 @@ Pong_PID ! {ping, self()},
 ```
 
 `self/0` returns the pid of the process that executes `self/0`, in this case the
-pid of "ping". (Recall the code for "pong", this lands up in the variable
+pid of "ping". (Recall the code for "pong", this ends up in the variable
 `Ping_PID` in the `receive` previously explained.)
 
 "Ping" now waits for a reply from "pong":
@@ -397,7 +397,7 @@ pong ! {ping, self()},
 ## Distributed Programming
 
 Let us rewrite the ping pong program with "ping" and "pong" on different
-computers. First a few things are needed to set up to get this to work. The
+computers. First a few things need to be set up to get this to work. The
 distributed Erlang implementation provides a very basic authentication mechanism
 to prevent unintentional access to an Erlang system on another computer. Erlang
 systems which talk to each other must have the same _magic cookie_. The easiest
@@ -438,7 +438,7 @@ Erlang system running on a computer is called an _Erlang node_.
 
 (Note: `erl -sname` assumes that all nodes are in the same 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 `-name` instead, but then all IP address must be given
+different domains we use `-name` instead, but then all IP addresses must be given
 in full.)
 
 Here is the ping pong example modified to run on two separate nodes:
@@ -483,20 +483,20 @@ started on kosken, called ping, and then a node on gollum, called pong.
 On kosken (on a Linux/UNIX system):
 
 ```text
-kosken> erl -sname ping
-Erlang (BEAM) emulator version 5.2.3.7 [hipe] [threads:0]
+kosken$ erl -sname ping
+Erlang/OTP 28 [erts-16.3] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1] [jit:ns]
 
-Eshell V5.2.3.7  (abort with ^G)
+Eshell V16.3 (press Ctrl+G to abort, type help(). for help)
 (ping@kosken)1>
 ```
 
 On gollum:
 
 ```text
-gollum> erl -sname pong
-Erlang (BEAM) emulator version 5.2.3.7 [hipe] [threads:0]
+gollum$ erl -sname pong
+Erlang/OTP 28 [erts-16.3] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1] [jit:ns]
 
-Eshell V5.2.3.7  (abort with ^G)
+Eshell V16.3 (press Ctrl+G to abort, type help(). for help)
 (pong@gollum)1>
 ```
 
@@ -533,7 +533,7 @@ Pong finished
 
 Looking at the `tut17` code, you see that the `pong` function itself is
 unchanged, the following lines work in the same way irrespective of on which
-node the "ping" process is executes:
+node the "ping" process is executed:
 
 ```erlang
 {ping, Ping_PID} ->
@@ -623,7 +623,7 @@ Before starting, notice the following:
 - This example only shows the message passing logic - no attempt has been made
   to provide a nice graphical user interface, although this can also be done in
   Erlang.
-- This sort of problem can be solved easier by use of the facilities in OTP,
+- This sort of problem can be solved more easily by using the facilities in OTP,
   which also provide methods for updating code on the fly and so on (see
   [OTP Design Principles](`e:system:design_principles.md`)).
 - The first program contains some inadequacies regarding handling of nodes which
@@ -666,9 +666,6 @@ File `messenger.erl`:
 %%% Reply {messenger, logged_on} logon was successful
 %%%
 %%% To server: {ClientPid, logoff}
-%%% Reply: {messenger, logged_off}
-%%%
-%%% To server: {ClientPid, logoff}
 %%% Reply: no reply
 %%%
 %%% To server: {ClientPid, message_to, ToName, Message} send a message
@@ -697,7 +694,7 @@ server_node() ->
     messenger@super.
 
 %%% This is the server process for the "messenger"
-%%% the user list has the format [{ClientPid1, Name1},{ClientPid22, Name2},...]
+%%% the user list has the format [{ClientPid1, Name1},{ClientPid2, Name2},...]
 server(User_List) ->
     receive
         {From, logon, Name} ->
@@ -734,22 +731,22 @@ server_logoff(From, User_List) ->
     lists:keydelete(From, 1, User_List).
 
 
-%%% Server transfers a message between user
+%%% Server transfers a message between users
 server_transfer(From, To, Message, User_List) ->
     %% check that the user is logged on and who he is
-    case lists:keysearch(From, 1, User_List) of
+    case lists:keyfind(From, 1, User_List) of
         false ->
             From ! {messenger, stop, you_are_not_logged_on};
-        {value, {From, Name}} ->
+        {From, Name} ->
             server_transfer(From, Name, To, Message, User_List)
     end.
 %%% If the user exists, send the message
 server_transfer(From, Name, To, Message, User_List) ->
     %% Find the receiver and send the message
-    case lists:keysearch(To, 2, User_List) of
+    case lists:keyfind(To, 2, User_List) of
         false ->
             From ! {messenger, receiver_not_found};
-        {value, {ToPid, To}} ->
+        {ToPid, To} ->
             ToPid ! {message_from, Name, Message},
             From ! {messenger, sent}
     end.
@@ -894,7 +891,7 @@ call. This would result in the process getting bigger and bigger for every loop.
 
 Functions in the `lists` module are used. 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 of tuples and looks
+`lists:keymember(Key,Position,List)` looks through a list of tuples and looks
 at `Position` in each tuple to see if it is the same as `Key`. The first element
 is position 1. If it finds a tuple where the element at `Position` is the same
 as `Key`, it returns `true`, otherwise `false`.
@@ -914,8 +911,8 @@ any) and returns the remaining list:
 [{x,y,z},{b,b,b},{q,r,s}]
 ```
 
-`lists:keysearch` is like `lists:keymember`, but it returns
-`{value,Tuple_Found}` or the atom `false`.
+`lists:keyfind` is like `lists:keymember`, but it returns
+`Tuple_Found` or the atom `false`.
 
 There are many very useful functions in the `lists` module.
 
@@ -974,10 +971,10 @@ server_transfer(From, fred, "hello", User_List),
 This checks that the pid `From` is in the `User_List`:
 
 ```erlang
-lists:keysearch(From, 1, User_List)
+lists:keyfind(From, 1, User_List)
 ```
 
-If `keysearch` returns the atom `false`, some error has occurred and the server
+If `keyfind` returns the atom `false`, some error has occurred and the server
 sends back the message:
 
 ```erlang
@@ -985,8 +982,8 @@ From ! {messenger, stop, you_are_not_logged_on}
 ```
 
 This is received by the client, which in turn does [`exit(normal)`](`exit/1`)
-and terminates. If `keysearch` returns `{value,{From,Name}}` it is certain that
-the user is logged on and that his name (peter) is in variable `Name`.
+and terminates. If `keyfind` returns `{From,Name}` it is certain that
+the user is logged on and that their name (peter) is in the variable `Name`.
 
 Let us now call:
 
@@ -995,11 +992,11 @@ server_transfer(From, peter, fred, "hello", User_List)
 ```
 
 Notice that as this is `server_transfer/5`, it is not the same as the previous
-function `server_transfer/4`. Another `keysearch` is done on `User_List` to find
+function `server_transfer/4`. Another `keyfind` is done on `User_List` to find
 the pid of the client corresponding to fred:
 
 ```erlang
-lists:keysearch(fred, 2, User_List)
+lists:keyfind(fred, 2, User_List)
 ```
 
 This time argument 2 is used, which is the second element in the tuple. If this
@@ -1012,10 +1009,10 @@ From ! {messenger, receiver_not_found};
 
 This is received by the client.
 
-If `keysearch` returns:
+If `keyfind` returns:
 
 ```erlang
-{value, {ToPid, fred}}
+{ToPid, fred}
 ```
 
 The following message is sent to fred's client:
diff --git a/system/doc/getting_started/records_macros.md b/system/doc/getting_started/records_macros.md
index eb47ffbc0b..e9db048c3d 100644
--- a/system/doc/getting_started/records_macros.md
+++ b/system/doc/getting_started/records_macros.md
@@ -59,7 +59,7 @@ introduced:
 %%% Configure the location of the server node,
 -define(server_node, messenger@super).
 
-%%%----END FILE----
+%%%----END FILE-----
 ```
 
 ```erlang
@@ -89,7 +89,7 @@ introduced:
 -record(message_to,{to_name, message}).
 %%% logoff
 
-%%%----END FILE----
+%%%----END FILE-----
 ```
 
 ```erlang
@@ -135,7 +135,7 @@ message(ToName, Message) ->
              ok
 end.
 
-%%%----END FILE----
+%%%----END FILE-----
 ```
 
 ```erlang
@@ -178,7 +178,7 @@ await_result() ->
             exit(timeout)
     end.
 
-%%%----END FILE---
+%%%----END FILE----
 ```
 
 ```erlang
@@ -194,7 +194,7 @@ server() ->
     process_flag(trap_exit, true),
     server([]).
 
-%%% the user list has the format [{ClientPid1, Name1},{ClientPid22, Name2},...]
+%%% the user list has the format [{ClientPid1, Name1},{ClientPid2, Name2},...]
 server(User_List) ->
     io:format("User list = ~p~n", [User_List]),
     receive
@@ -230,27 +230,27 @@ server_logon(From, Name, User_List) ->
 server_logoff(From, User_List) ->
     lists:keydelete(From, 1, User_List).
 
-%%% Server transfers a message between user
+%%% Server transfers a message between users
 server_transfer(From, To, Message, User_List) ->
     %% check that the user is logged on and who he is
-    case lists:keysearch(From, 1, User_List) of
+    case lists:keyfind(From, 1, User_List) of
         false ->
             From ! #abort_client{message=you_are_not_logged_on};
-        {value, {_, Name}} ->
+        {_, Name} ->
             server_transfer(From, Name, To, Message, User_List)
     end.
 %%% If the user exists, send the message
 server_transfer(From, Name, To, Message, User_List) ->
     %% Find the receiver and send the message
-    case lists:keysearch(To, 2, User_List) of
+    case lists:keyfind(To, 2, User_List) of
         false ->
             From ! #server_reply{message=receiver_not_found};
-        {value, {ToPid, To}} ->
+        {ToPid, To} ->
             ToPid ! #message_from{from_name=Name, message=Message},
             From !  #server_reply{message=sent}
     end.
 
-%%%----END FILE---
+%%%----END FILE----
 ```
 
 ## Header Files
@@ -269,7 +269,7 @@ for example:
 ```
 
 In the case above the file is fetched from the same directory as all the other
-files in the messenger example. (_manual_).
+files in the messenger example. (_manual_)
 
 .hrl files can contain any valid Erlang code but are most often used for record
 and macro definitions.
@@ -297,7 +297,7 @@ This is equivalent to:
 Creating a record is best illustrated by an example:
 
 ```erlang
-#message_to{message="hello", to_name=fred)
+#message_to{message="hello", to_name=fred}
 ```
 
 This creates:
@@ -306,8 +306,8 @@ This creates:
 {message_to, fred, "hello"}
 ```
 
-Notice that you do not have to worry about the order you assign values to the
-various parts of the records when you create it. The advantage of using records
+Notice that you do not have to worry about the order in which you assign values to the
+various parts of a record when you create it. The advantage of using records
 is that by placing their definitions in header files you can conveniently define
 interfaces that are easy to change. For example, if you want to add a new field
 to the record, you only have to change the code where the new field is used and
@@ -358,7 +358,7 @@ This is a standard macro (that is, defined by the system, not by the user).
 of using macros with, for example, [parameters](macros.md#defining-and-using-macros).
 
 The three Erlang (`.erl`) files in the messenger example are individually
-compiled into object code file (`.beam`). The Erlang system loads and links
+compiled into object code files (`.beam`). The Erlang system loads and links
 these files into the system when they are referred to during execution of the
 code. In this case, they are simply put in our current working directory (that
 is, the place you have done "cd" to). There are ways of putting the `.beam`
diff --git a/system/doc/getting_started/robustness.md b/system/doc/getting_started/robustness.md
index d1d081337f..b91a49f94e 100644
--- a/system/doc/getting_started/robustness.md
+++ b/system/doc/getting_started/robustness.md
@@ -25,7 +25,7 @@ Several things are wrong with the messenger example in
 [A Larger Example](conc_prog.md#ex). For example, if a node where a user is
 logged on goes down without doing a logoff, the user remains in the server's
 `User_List`, but the client disappears. This makes it impossible for the user to
-log on again as the server thinks the user already is logged on.
+log on again as the server thinks the user is already logged on.
 
 Or what happens if the server goes down in the middle of sending a message,
 leaving the sending client hanging forever in the `await_result` function?
@@ -115,7 +115,7 @@ is canceled if `{ping,Ping_PID}` is received. If `{ping,Ping_PID}` is not
 received, the actions following the time-out are done after 5000 milliseconds.
 `after` must be last in the `receive`, that is, preceded by all other message
 reception specifications in the `receive`. It is also possible to call a
-function that returned an integer for the time-out:
+function that returns an integer for the time-out:
 
 ```erlang
 after pong_timeout() ->
@@ -221,7 +221,7 @@ sent to "pong", which also terminates.
 
 It is possible to modify the default behaviour of a process so that it does not
 get killed when it receives abnormal exit signals. Instead, all signals are
-turned into normal messages on the format `{'EXIT',FromPID,Reason}` and added to
+turned into normal messages of the format `{'EXIT',FromPID,Reason}` and added to
 the end of the receiving process' message queue. This behaviour is set by:
 
 ```erlang
@@ -346,7 +346,7 @@ server_node() ->
     messenger@super.
 
 %%% This is the server process for the "messenger"
-%%% the user list has the format [{ClientPid1, Name1},{ClientPid22, Name2},...]
+%%% the user list has the format [{ClientPid1, Name1},{ClientPid2, Name2},...]
 server() ->
     process_flag(trap_exit, true),
     server([]).
@@ -387,23 +387,23 @@ server_logoff(From, User_List) ->
     lists:keydelete(From, 1, User_List).
 
 
-%%% Server transfers a message between user
+%%% Server transfers a message between users
 server_transfer(From, To, Message, User_List) ->
     %% check that the user is logged on and who he is
-    case lists:keysearch(From, 1, User_List) of
+    case lists:keyfind(From, 1, User_List) of
         false ->
             From ! {messenger, stop, you_are_not_logged_on};
-        {value, {_, Name}} ->
+        {_, Name} ->
             server_transfer(From, Name, To, Message, User_List)
     end.
 
 %%% If the user exists, send the message
 server_transfer(From, Name, To, Message, User_List) ->
     %% Find the receiver and send the message
-    case lists:keysearch(To, 2, User_List) of
+    case lists:keyfind(To, 2, User_List) of
         false ->
             From ! {messenger, receiver_not_found};
-        {value, {ToPid, To}} ->
+        {ToPid, To} ->
             ToPid ! {message_from, Name, Message},
             From ! {messenger, sent}
     end.
@@ -469,10 +469,10 @@ unreachable for one of the following reasons:
 - The user has logged off (the "logoff" message is removed).
 - The network connection to the client is broken.
 - The node on which the client process resides has gone down.
-- The client processes has done some illegal operation.
+- The client process has done some illegal operation.
 
 If an exit signal is received as above, the tuple `{From,Name}` is deleted from
-the servers `User_List` using the `server_logoff` function. If the node on which
+the server's `User_List` using the `server_logoff` function. If the node on which
 the server runs goes down, an exit signal (automatically generated by the
 system) is sent to all of the client processes:
 `{'EXIT',MessengerPID,noconnection}` causing all the client processes to
diff --git a/system/doc/getting_started/seq_prog.md b/system/doc/getting_started/seq_prog.md
index 69de6469cb..d29d1a48ee 100644
--- a/system/doc/getting_started/seq_prog.md
+++ b/system/doc/getting_started/seq_prog.md
@@ -23,10 +23,10 @@ limitations under the License.
 
 ## The Erlang Shell
 
-Most operating systems have a command interpreter or shell, UNIX and Linux have
-many, Windows has the command prompt, powershell and more. Erlang has its own shell
-where bits of Erlang code can be written directly, and be evaluated to see what happens (see
-the `m:shell` manual page in STDLIB).
+Most operating systems have a command interpreter or shell. UNIX and Linux have
+many. Windows has the command prompt, PowerShell, and more. Erlang has its own
+shell where you can write and evaluate bits of Erlang code directly (see the
+`m:shell` manual page in STDLIB).
 
 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
@@ -34,9 +34,9 @@ like this.
 
 ```text
 $ erl
-Erlang R15B (erts-5.9.1) [source] [smp:8:8] [rq:8] [async-threads:0] [hipe] [kernel-poll:false]
+Erlang/OTP 28 [erts-16.3] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1] [jit:ns]
 
-Eshell V5.9.1  (abort with ^G)
+Eshell V16.3 (press Ctrl+G to abort, type help(). for help)
 1>
 ```
 
@@ -50,8 +50,8 @@ and a carriage return.
 2> 
 ```
 
-As shown, the Erlang shell numbers the lines that can be entered, (as 1> 2>) and
-that it correctly says that 2 + 5 is 7. If you make writing mistakes in the
+As shown, the Erlang shell numbers the lines that can be entered (as `1>`, `2>`, ...)
+and correctly says that 2 + 5 is 7. If you make writing mistakes in the
 shell, you can delete with the backspace key, as in most shells. There are many
 more editing commands in the shell (see
 [tty - A command line interface](`e:erts:tty.md`) in ERTS User's Guide).
@@ -93,10 +93,10 @@ $
 
 ## Modules and Functions
 
-A programming language is not much use if you only can run code from the shell.
+A programming language is not much use if you can only run code from the shell.
 So here is a small Erlang program. Enter it into a file named `tut.erl` using a
 suitable text editor. The file name `tut.erl` is important, and also that it is
-in the same directory as the one where you started `erl`). If you are lucky your
+in the same directory as the one where you started `erl`. If you are lucky, your
 editor has an Erlang mode that makes it easier for you to enter and format your
 code nicely (see [The Erlang mode for Emacs](`e:tools:erlang_mode_chapter.md`)
 in Tools User's Guide), but you can manage perfectly well without. Here is the
@@ -121,7 +121,7 @@ This can be done in an Erlang shell as follows, where `c` means compile:
 
 The `{ok,tut}` means that the compilation is OK. If it says `error` it means
 that there is some mistake in the text that you entered. Additional error
-messages gives an idea to what is wrong so you can modify the text and then try
+messages give an idea about what is wrong so you can modify the text and then try
 to compile the program again.
 
 Now run the program:
@@ -164,7 +164,7 @@ module `tut`. More about this later. Again, notice the `.` at the end of the
 line.
 
 Now for a more complicated example, the factorial of a number. For example, the
-factorial of 4 is 4 _ 3 _ 2 * 1, which equals 24.
+factorial of 4 is `4 * 3 * 2 * 1`, which equals 24.
 
 Enter the following code in a file named `tut1.erl`:
 
@@ -178,10 +178,10 @@ fac(N) ->
     N * fac(N - 1).
 ```
 
-So this is a module, called `tut1` that contains a function called `fac>`, which
+So this is a module called `tut1` that contains a function called `fac`, which
 takes one argument, `N`.
 
-The first part says that the factorial of 1 is 1.:
+The first part says that the factorial of 1 is 1:
 
 ```erlang
 fac(1) ->
@@ -189,7 +189,7 @@ fac(1) ->
 ```
 
 Notice that this part ends with a semicolon `;` that indicates that there is
-more of the function `fac>` to come.
+more of the function `fac` to come.
 
 The second part says that the factorial of N is N multiplied by the factorial of
 N - 1:
@@ -216,7 +216,7 @@ And now calculate the factorial of 4.
 24
 ```
 
-Here the function `fac>` in module `tut1` is called with argument `4`.
+Here the function `fac` in module `tut1` is called with argument `4`.
 
 A function can have many arguments. Let us expand the module `tut1` with the
 function to multiply two numbers:
@@ -258,12 +258,12 @@ variables are `Number`, `ShoeSize`, and `Age`.
 
 ## Atoms
 
-Atom is another data type in Erlang. Atoms start with a small letter (see
+Atoms are another data type in Erlang. Atoms start with a lowercase letter (see
 [Atom](`e:system:data_types.md`)), for example, `charles`, `centimeter`, and
 `inch`. Atoms are simply names, nothing else. They are not like variables, which
 can have a value.
 
-Enter the next program in a file named `tut2.erl`). It can be useful for
+Enter the next program in a file named `tut2.erl`. It can be useful for
 converting from inches to centimeters and conversely:
 
 ```erlang
@@ -338,7 +338,7 @@ curly brackets, `{` and `}`.
 
 So, `{inch,3}` denotes 3 inches and `{centimeter,5}` denotes 5 centimeters. Now
 let us write a new program that converts centimeters to inches and conversely.
-Enter the following code in a file called `tut3.erl`):
+Enter the following code in a file called `tut3.erl`:
 
 ```erlang
 -module(tut3).
@@ -361,8 +361,8 @@ Compile and test:
 {inch,5.0}
 ```
 
-Notice on line 16 that 5 inches is converted to centimeters and back again and
-reassuringly get back to the original value. That is, the argument to a function
+Notice on line 16 that 5 inches are converted to centimeters and back again,
+yielding the original value. This also shows that the argument to a function
 can be the result of another function. Consider how line 16 (above) works. The
 argument given to the function `{inch,5}` is first matched against the first
 head clause of `convert_length`, that is, `convert_length({centimeter,X})`. It
@@ -386,7 +386,7 @@ is `{c,-10}`. Here `c` represents Celsius and `f` Fahrenheit.
 
 ## Lists
 
-Whereas tuples group things together, it is also needed to represent lists of
+Whereas tuples group things together, it is also necessary to represent lists of
 things. Lists in Erlang are surrounded by square brackets, `[` and `]`. For
 example, a list of the temperatures of various cities in the world can be:
 
@@ -399,7 +399,7 @@ Notice that this list was so long that it did not fit on one line. This does not
 matter, Erlang allows line breaks at all "sensible places" but not, for example,
 in the middle of atoms, integers, and others.
 
-A useful way of looking at parts of lists, is by using `|`. This is best
+A useful way of looking at parts of lists is by using `|`. This is best
 explained by an example using the shell:
 
 ```erlang
@@ -411,8 +411,8 @@ explained by an example using the shell:
 [2,3,4,5]
 ```
 
-To separate the first elements of the list from the rest of the list, `|` is
-used. `First` has got value `1` and `TheRest` has got the value `[2,3,4,5]`.
+To separate the first element of the list from the rest of the list, `|` is
+used. `First` has the value `1` and `TheRest` has the value `[2,3,4,5]`.
 
 Another example:
 
@@ -519,7 +519,7 @@ Let us jump straight into the deep end with an example using some interesting
 features.
 
 The following example shows how to calculate alpha blending using maps to
-reference color and alpha channels. Enter the code in a file named `color.erl`):
+reference color and alpha channels. Enter the code in a file named `color.erl`:
 
 ```erlang
 -module(color).
@@ -642,7 +642,7 @@ existing key with a new value is with the `:=` operator.
 Erlang has many standard modules to help you do things. For example, the module
 `m:io` contains many functions that help in doing formatted input/output. To look
 up information about standard modules, the command `h(..)` can be used at the
-erlang shell. Try the erlang shell command:
+Erlang shell. Try the Erlang shell command:
 
 ```text
 1> h(io).
@@ -684,7 +684,7 @@ ok
 The function `io:format/2` (that is, `format` with two arguments) takes two lists.
 The first one is nearly always a list written between `" "`. This list is printed
 out as it is, except that each `~w` is replaced by a term taken in order from the
-second list. Each ~n is replaced by a new line. The `io:format/2` function
+second list. Each `~n` is replaced by a new line. The `io:format/2` function
 itself returns the atom `ok` if everything goes as planned. Like other functions
 in Erlang, it crashes if an error occurs. This is not a fault in Erlang, it is a
 deliberate policy. Erlang has sophisticated mechanisms to handle errors which
@@ -747,7 +747,7 @@ When `format_temps` is called the first time, `City` gets the value
 `{moscow,{c,-10}}` and `Rest` is the rest of the list. So the function
 `print_temp(convert_to_celsius({moscow,{c,-10}}))` is called.
 
-Here is a function call as `convert_to_celsius({moscow,{c,-10}})` as the
+Here is a function call with `convert_to_celsius({moscow,{c,-10}})` as the
 argument to the function `print_temp`. When function calls are _nested_ like
 this, they execute (evaluate) from the inside out. That is, first
 `convert_to_celsius({moscow,{c,-10}})` is evaluated, which gives the value
@@ -810,7 +810,7 @@ value of the head of the list. In the above this would be
 `list_max([2,3,4,5,7,4,3,2,1],1)`. If you tried to use `list_max/1` with an
 empty list or tried to use it with something that is not a list at all, you
 would cause an error. Notice that the Erlang philosophy is not to handle errors
-of this type in the function they occur, but to do so elsewhere. More about this
+of this type in the function in which they occur, but to do so elsewhere. More about this
 later.
 
 In `list_max/2`, you walk down the list and use `Head` instead of
@@ -834,7 +834,7 @@ Some useful operators in guards are:
 (see [Guard Sequences](`e:system:expressions.md`)).
 
 To change the above program to one that works out the minimum value of the
-element in a list, you only need to write < instead of >. (But it would be wise
+elements in a list, you only need to write `<` instead of `>`. (But it would be wise
 to change the name of the function to `list_min`.)
 
 Earlier it was mentioned that a variable can only be given a value once in its
@@ -843,8 +843,8 @@ is OK since every time you call `list_max/2` you create a new scope and one can
 regard `Result_so_far` as a different variable in each scope.
 
 Another way of creating and giving a variable a value is by using the match
-operator = . So if you write `M = 5`, a variable called `M` is created with the
-value 5. If, in the same scope, you then write `M = 6`, an error is returned.
+operator `=`. So if you write `M = 5`, a variable called `M` is created with the
+value `5`. If, in the same scope, you then write `M = 6`, an error is returned.
 Try this out in the shell:
 
 ```erlang
@@ -936,14 +936,14 @@ reverse([], Reversed_List) ->
 ```
 
 Consider how `Reversed_List` is built. It starts as [], then successively the
-heads are taken off of the list to be reversed and added to the the
+heads are taken off of the list to be reversed and added to the
 `Reversed_List`, as shown in the following:
 
 ```erlang
-reverse([1|2,3], []) =>
+reverse([1|[2,3]], []) =>
     reverse([2,3], [1|[]])
 
-reverse([2|3], [1]) =>
+reverse([2|[3]], [1]) =>
     reverse([3], [2|[1]])
 
 reverse([3|[]], [2,1]) =>
@@ -955,7 +955,7 @@ reverse([], [3,2,1]) =>
 
 The module `lists` contains many functions for manipulating lists, for example,
 for reversing them. So before writing a list-manipulating function it is a good
-idea to check if one not already is written for you (see the `m:lists` manual
+idea to check if one has not already been written for you (see the `m:lists` manual
 page in STDLIB).
 
 Now let us get back to the cities and temperatures, but take a more structured
@@ -1002,7 +1002,7 @@ format_temps(List_of_cities) ->
 
 Here `format_temps/1` calls `convert_list_to_c/1`. `convert_list_to_c/1` takes
 off the head of the `List_of_cities`, converts it to Celsius if needed. The `|`
-operator is used to add the (maybe) converted to the converted rest of the list:
+operator is used to add the (maybe converted) value to the rest of the list:
 
 ```erlang
 [Converted_City | convert_list_to_c(Rest)];
@@ -1139,9 +1139,9 @@ ok
 ## If and Case
 
 The function `find_max_and_min` works out the maximum and minimum temperature. A
-new construct, `if`, is introduced here. If works as follows:
+new construct, `if`, is introduced here. `if` works as follows:
 
-```c
+```erlang
 if
     Condition 1 ->
         Action 1;
@@ -1306,7 +1306,7 @@ month_length(Year, Month) ->
 BIFs are functions that for some reason are built-in to the Erlang virtual
 machine. BIFs often implement functionality that is impossible or is too
 inefficient to implement in Erlang. Some BIFs can be called using the function
-name only but they are by default belonging to the `erlang` module. For example,
+name only, but by default they belong to the `erlang` module. For example,
 the call to the BIF `trunc` below is equivalent to a call to `erlang:trunc`.
 
 As shown, first it is checked if a year is leap. If a year is divisible by 400,
@@ -1328,9 +1328,9 @@ trunc(5.0) = 5
 5 * 400 = 2000
 ```
 
-That is, a leap year. The next two `trunc`\-tests evaluate if the year is
+That is, a leap year. The next two `trunc`-tests evaluate if the year is
 divisible by 100 or 4 in the same way. The first `if` returns `leap` or
-`not_leap`, which lands up in the variable `Leap`. This variable is used in the
+`not_leap`, which ends up in the variable `Leap`. This variable is used in the
 guard for `feb` in the following `case` that tells us how long the month is.
 
 This example showed the use of `trunc`. It is easier to use the Erlang operator
@@ -1407,9 +1407,11 @@ functions. Here is an example using the shell:
 10
 ```
 
-Here is defined a function that doubles the value of a number and assigned this
-function to a variable. Thus `Xf(5)` returns value 10. Two useful functions when
-working with lists are `foreach` and `map`, which are defined as follows:
+Here a function that doubles the value of a number is defined and assigned to
+a variable. Thus `Xf(5)` returns value 10.
+
+Two useful functions when working with lists are `foreach` and `map`, which
+are defined as follows:
 
 ```erlang
 foreach(Fun, [First|Rest]) ->
@@ -1424,10 +1426,10 @@ map(Fun, []) ->
     [].
 ```
 
-These two functions are provided in the standard module `lists`. `foreach` takes
+These two functions are provided in the standard library module `lists`. `foreach` takes
 a list and applies a fun to every element in the list. `map` creates a new list
 by applying a fun to every element in a list. Going back to the shell, `map` is
-used and a fun to add 3 to every element of a list:
+used with a fun to add 3 to every element of a list:
 
 ```erlang
 88> Add_3 = fun(X) -> X + 3 end.
@@ -1486,8 +1488,8 @@ lists:map(fun convert_to_c/1, List)
 ```
 
 When a function defined elsewhere is used as a fun, it can be referred to as
-`Function/Arity` (remember that `Arity` = number of arguments). So in the
-`map`\-call `lists:map(fun convert_to_c/1, List)` is written. As shown,
+`fun Function/Arity` (remember that `Arity` = number of arguments). That is
+why `fun convert_to_c/1` can be used in the call above. As shown,
 `convert_list_to_c` becomes much shorter and easier to understand.
 
 The standard module `lists` also contains a function `sort(Fun, List)` where
-- 
2.51.0

openSUSE Build Service is sponsored by