Skip to content

Commit 5a2f219

Browse files
Fix typos in Design Principles
Co-authored-by: Maria Scott <maria-12648430@hnc-agency.org>
1 parent 5c44cb6 commit 5a2f219

9 files changed

Lines changed: 40 additions & 39 deletions

File tree

system/doc/design_principles/applications.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ After creating code to implement a specific functionality, you might
3232
consider transforming it into an *application* — a component that can be
3333
started and stopped as a unit, as well as reused in other systems.
3434

35-
The steps to create an application is as follows:
35+
The steps to create an application are as follows:
3636

3737
* Create an [application callback
3838
module](applications.md#callback_module) that describes how the
@@ -240,8 +240,8 @@ Other directories in the development environment may be needed. If source code
240240
from languages other than Erlang is used, for instance C-code for NIFs, that
241241
code should be placed in a separate directory. By convention it is recommended
242242
to prefix such directories with the language name, for example `c_src` for C,
243-
`java_src` for Java or `go_src` for Go. Directories with `_src` suffix indicates
244-
that it is a part of the application and the compilation step. The final build
243+
`java_src` for Java or `go_src` for Go. Directories with `_src` suffix indicate
244+
that they are a part of the application and the compilation step. The final build
245245
artifacts should target the `priv/lib` or `priv/bin` directories.
246246

247247
The `priv` directory holds assets that the application needs during runtime.
@@ -309,7 +309,7 @@ A released application must follow a certain structure.
309309

310310
The `src` directory could be useful to release for debugging purposes,
311311
but this is not required. The `include` directory should only be
312-
released if the applications has public include files.
312+
released if the application has public include files.
313313

314314
It is encouraged to omit empty directories.
315315

@@ -406,7 +406,7 @@ ok
406406

407407
The application master stops the application by telling the top supervisor to
408408
shut down. The top supervisor tells all its child processes to shut down, and so
409-
on; the entire tree is terminated in reversed start order. The application
409+
on; the entire tree is terminated in reverse start order. The application
410410
master then calls the application callback function `stop/1` in the module
411411
defined by the `mod` key.
412412

system/doc/design_principles/appup_cookbook.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ code_change(_Vsn, Chs, _Extra) ->
116116
```
117117

118118
The first argument is `{down,Vsn}` if there is a downgrade, or `Vsn` if there is
119-
a upgrade. The term `Vsn` is fetched from the 'original' version of the module,
119+
an upgrade. The term `Vsn` is fetched from the 'original' version of the module,
120120
that is, the version you are upgrading from, or downgrading to.
121121

122122
The version is defined by the module attribute `vsn`, if any. There is no such
@@ -133,7 +133,7 @@ example in [Release Handling](release_handling.md#appup), where a function
133133
`available/0` is added to `ch3`.
134134

135135
If a call is added to this function, say in module `m1`, a runtime error could
136-
can occur during release upgrade if the new version of `m1` is loaded first and
136+
occur during release upgrade if the new version of `m1` is loaded first and
137137
calls `ch3:available/0` before the new version of `ch3` is loaded.
138138

139139
Thus, `ch3` must be loaded before `m1`, in the upgrade case, and conversely in
@@ -263,7 +263,7 @@ the restart strategy and maximum restart frequency properties, as well as
263263
changing the existing child specifications.
264264

265265
Child processes can be added or deleted, but this is not handled automatically.
266-
Instructions must be given by in the `.appup` file.
266+
Instructions must be given in the `.appup` file.
267267

268268
### Changing Properties
269269

@@ -396,6 +396,7 @@ A new functional module `m` is added to `ch_app`:
396396
{"2",
397397
[{"1", [{add_module, m}]}],
398398
[{"1", [{delete_module, m}]}]
399+
}.
399400
```
400401

401402
## Starting or Terminating a Process
@@ -467,7 +468,7 @@ manually created.
467468
_Example_
468469

469470
Assume there is a release containing an application `prim_app`, which
470-
have a supervisor `prim_sup` in its supervision tree.
471+
has a supervisor `prim_sup` in its supervision tree.
471472

472473
In a new version of the release, the application `ch_app` is to be included in
473474
`prim_app`. That is, its topmost supervisor `ch_sup` is to be started as a child
@@ -572,7 +573,7 @@ processes to/from `prim_sup` with instructions for loading/unloading all
572573
Again, the `.relup` file is created manually, either from scratch or by editing a
573574
generated version. Load all code for `ch_app` first, and also load the
574575
application specification, before `prim_sup` is updated. When downgrading,
575-
`prim_sup` is to updated first, before the code for `ch_app` and its application
576+
`prim_sup` is to be updated first, before the code for `ch_app` and its application
576577
specification are unloaded.
577578

578579
```erlang

system/doc/design_principles/design_principles.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ structuring model based on the idea of _workers_ and _supervisors_:
3838
and workers, which makes it possible to design and program fault-tolerant
3939
software.
4040

41-
In the following figure, square boxes represents supervisors and circles
41+
In the following figure, square boxes represent supervisors and circles
4242
represent workers:
4343

4444
[](){: #sup6 }
@@ -74,7 +74,7 @@ The behaviour module is part of Erlang/OTP. To implement a process such as a
7474
supervisor, the user only needs to implement the callback module, which is to
7575
export a pre-defined set of functions, the _callback functions_.
7676

77-
The following example illustrate how code can be divided into a generic and a
77+
The following example illustrates how code can be divided into a generic and a
7878
specific part. Consider the following code (written in plain Erlang) for a
7979
simple server, which keeps track of a number of "channels". Other processes can
8080
allocate and free the channels by calling the functions `alloc/0` and `free/1`,
@@ -289,7 +289,7 @@ How to program applications is described in [Applications](applications.md).
289289

290290
## Releases
291291

292-
A _release_ is a complete system made out from a subset of Erlang/OTP
292+
A _release_ is a complete system made from a subset of Erlang/OTP
293293
applications and a set of user-specific applications.
294294

295295
How to program releases is described in [Releases](release_structure.md).

system/doc/design_principles/distributed_applications.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ distributed in the sense that they, for example, use services on other nodes.
3636

3737
Since a distributed application can move between nodes, some addressing
3838
mechanism is required to ensure that it can be addressed by other applications,
39-
regardless on which node it currently executes. This issue is not addressed
39+
regardless of which node it currently executes. This issue is not addressed
4040
here, but the `m:global` or `m:pg` modules in Kernel can be used for this purpose.
4141

4242
## Specifying Distributed Applications

system/doc/design_principles/gen_server_concepts.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ set in the supervisor.
234234

235235
If it is necessary to clean up before termination, the shutdown strategy
236236
must be a time-out value and the `gen_server` must be set to trap exit signals
237-
in function `init`. When ordered to shutdown, the `gen_server` then calls
237+
in function `init`. When ordered to shut down, the `gen_server` then calls
238238
the callback function `terminate(shutdown, State)`:
239239

240240
```erlang
@@ -259,7 +259,7 @@ can be useful, for example:
259259

260260
```erlang
261261
...
262-
export([stop/0]).
262+
-export([stop/0]).
263263
...
264264

265265
stop() ->

system/doc/design_principles/release_handling.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ of the Kernel, STDLIB, and SASL applications.
4949
_Step 1_) A release is created as described in [Releases](release_structure.md).
5050

5151
_Step 2_) The release is transferred to and installed at target environment. For
52-
information of how to install the first target system, see
52+
information on how to install the first target system, see
5353
[System Principles](`e:system:create_target.md`).
5454

5555
_Step 3_) Modifications, for example, error corrections, are made to the code in
5656
the development environment.
5757

58-
_Step 4_) At some point, it is time to make a new version of release. The
58+
_Step 4_) At some point, it is time to make a new version of the release. The
5959
relevant `.app` files are updated and a new `.rel` file is written.
6060

6161
_Step 5_) For each modified application, an
@@ -240,7 +240,7 @@ If a new module is introduced, the following instruction is used:
240240
```
241241

242242
This instruction loads module `Module`. When running Erlang in
243-
embedded mode it is necessary to use this this instruction. It is not
243+
embedded mode it is necessary to use this instruction. It is not
244244
strictly required when running Erlang in interactive mode, since the
245245
code server automatically searches for and loads unloaded modules.
246246

@@ -695,7 +695,7 @@ function `ch3:available/0` is now available:
695695
".../lib/ch_app-1/ebin/ch_sup.beam"
696696
```
697697

698-
Processes in `ch_app` for which code have not been updated, for example, the
698+
Processes in `ch_app` for which code has not been updated, for example, the
699699
supervisor, are still evaluating code from `ch_app-1`.
700700

701701
_Step 8)_ If the target system is now rebooted, it uses version "A" again. The
@@ -735,7 +735,7 @@ When an installed release is made permanent, the system process `init` is set to
735735
point out the new `sys.config`.
736736

737737
After the installation, the application controller compares the old and new
738-
configuration parameters for all running applications and call the callback
738+
configuration parameters for all running applications and calls the callback
739739
function:
740740

741741
```erlang

system/doc/design_principles/spec_proc.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ is to be called:
306306
sys:handle_debug(Deb, Func, Info, Event) => Deb1
307307
```
308308
309-
The arguments have the follow meaning:
309+
The arguments have the following meaning:
310310
311311
- `Deb` is the debug structure as returned from `sys:debug_options/1`.
312312
- `Func` is a fun specifying a (user-defined) function used to format trace
@@ -373,10 +373,10 @@ The arguments have the following meaning:
373373
- `Request` and `From` from the received system message are to be
374374
passed as-is to the call to `sys:handle_system_msg/6`.
375375
- `Parent` is the pid of the parent process.
376-
- `Module` is the name of the module implementing the speciall process.
376+
- `Module` is the name of the module implementing the special process.
377377
- `Deb` is the debug structure.
378378
- `State` is a term describing the internal state and is passed on to
379-
`Module:system_continue/3`, `Module:system_terminate/4`/
379+
`Module:system_continue/3`, `Module:system_terminate/4`,
380380
`Module:system_get_state/1`, and `Module:system_replace_state/2`.
381381
382382
`sys:handle_system_msg/6` does not return. It handles the system
@@ -394,7 +394,7 @@ one of the following functions:
394394
* `Module:system_get_state(State)` - if the process is to return its state.
395395
396396
* `Module:system_replace_state(StateFun, State)` - if the process is
397-
to replace its state using the fun `StateFun` fun. See `sys:replace_state/3`
397+
to replace its state using the fun `StateFun`. See `sys:replace_state/3`
398398
for more information.
399399
400400
* `system_code_change(Misc, Module, OldVsn, Extra)` - if the process is to
@@ -403,7 +403,7 @@ one of the following functions:
403403
A process in a supervision tree is expected to terminate with the same reason as
404404
its parent.
405405
406-
In the example, system messages are handed by the following code:
406+
In the example, system messages are handled by the following code:
407407
408408
```erlang
409409
loop(Chs, Parent, Deb) ->
@@ -422,7 +422,7 @@ system_terminate(Reason, Parent, Deb, Chs) ->
422422
exit(Reason).
423423
424424
system_get_state(Chs) ->
425-
{ok, Chs, Chs}.
425+
{ok, Chs}.
426426
427427
system_replace_state(StateFun, Chs) ->
428428
NChs = StateFun(Chs),
@@ -543,7 +543,7 @@ init(Parent, Name, Module) ->
543543
...,
544544
Dbg = sys:debug_options([]),
545545
proc_lib:init_ack(Parent, {ok, self()}),
546-
loop(Parent, Module, Deb, ...).
546+
loop(Parent, Module, Dbg, ...).
547547
548548
...
549549
```

system/doc/design_principles/statem.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ to the [`handle_event()`](`c:gen_statem:handle_event/4`) callback. The
243243
other arguments are the `EventType` and the event dependent `EventContent`,
244244
both described in section
245245
[_Event Types and Event Content_](#event-types-and-event-content),
246-
and the the last argument is the current server `Data`.
246+
and the last argument is the current server `Data`.
247247

248248
[_State Enter Calls_](#state-enter-calls) (see that section)
249249
are also handled by the event handler and have slightly different arguments.
@@ -323,7 +323,7 @@ _transition actions_:
323323
If `true` postpone the current event, see section
324324
[_Postponing Events_](#postponing-events).
325325

326-
- **[`{hibernate, Boolean`](`t:gen_statem:hibernate/0`)** -
326+
- **[`{hibernate, Boolean}`](`t:gen_statem:hibernate/0`)** -
327327
If `true` hibernate the `gen_statem`, treated in section
328328
[_Hibernation_](#hibernation).
329329

@@ -512,7 +512,7 @@ the time-out is restarted with the new time and event content.
512512

513513
All time-outs have an `EventContent` that is part of the
514514
[_transition action_](#transition-actions) that starts the time-out.
515-
Different `EventContent`s does not create different time-outs. The
515+
Different `EventContent`s do not create different time-outs. The
516516
`EventContent` is delivered to the [_state callback_](#state-callback)
517517
when the time-out expires.
518518

@@ -689,7 +689,7 @@ function `code_lock:init(Code)`. This function is expected to return
689689
in this case `locked`; assuming that the door is locked to begin with.
690690
`Data` is the internal server data of the `gen_statem`. Here the server data
691691
is a [`map()`](`m:maps`) with key `code` that stores the correct
692-
button sequence, key `length` store its length, and key `buttons`
692+
button sequence, key `length` stores its length, and key `buttons`
693693
that stores the collected buttons up to the same length.
694694

695695
```erlang
@@ -705,7 +705,7 @@ and is ready to receive events.
705705

706706
Function [`gen_statem:start_link/3,4`](`gen_statem:start_link/3`)
707707
must be used if the `gen_statem` is part of a supervision tree, that is,
708-
started by a supervisor. Function,
708+
started by a supervisor. Function
709709
[`gen_statem:start/3,4`](`gen_statem:start/3`) can be used to start
710710
a standalone `gen_statem`, meaning it is not part of a supervision tree.
711711

@@ -785,7 +785,7 @@ State Time-Outs
785785
---------------
786786

787787
When a correct code has been given, the door is unlocked and the following
788-
tuple is returned from `locked/2`:
788+
tuple is returned from `locked/3`:
789789

790790
```erlang
791791
{next_state, open, Data#{buttons := []},
@@ -1035,7 +1035,7 @@ the _event time-out_.
10351035
Generic Time-Outs
10361036
-----------------
10371037
1038-
The previous example of _state time-outs_ only work if the state machine stays
1038+
The previous example of _state time-outs_ only works if the state machine stays
10391039
in the same state during the time-out time. And _event time-outs_ only work
10401040
if no disturbing unrelated events occur.
10411041
@@ -1150,7 +1150,7 @@ Postponing is ordered by the
11501150
[_transition action_](#transition-actions) `postpone`.
11511151
11521152
In this example, instead of ignoring button events while in the `open` state,
1153-
we can postpone them handle them later in the `locked` state:
1153+
we can postpone them and handle them later in the `locked` state:
11541154
11551155
```erlang
11561156
...
@@ -1284,7 +1284,7 @@ just need to handle these event-like calls in all states.
12841284
...
12851285
init(Code) ->
12861286
process_flag(trap_exit, true),
1287-
Data = #{code => Code, length = length(Code)},
1287+
Data = #{code => Code, length => length(Code)},
12881288
{ok, locked, Data}.
12891289

12901290
callback_mode() ->
@@ -1327,7 +1327,7 @@ state machine. This can be done with the
13271327
[`{next_eventEventTypeEventContent}`](`t:gen_statem:action/0`).
13281328

13291329
You can generate events of any existing [type](`t:gen_statem:action/0`),
1330-
but the`internal` type can only be generated through action `next_event`.
1330+
but the `internal` type can only be generated through action `next_event`.
13311331
Hence, it cannot come from an external source, so you can be certain
13321332
that an `internal` event is an event from your state machine to itself.
13331333

system/doc/design_principles/sup_princ.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ child_spec() = #{id => child_id(), % mandatory
513513
`M` comes from the child's start `{M,F,A}`.
514514

515515
_Example:_ The child specification to start the server `ch3` in the previous
516-
example look as follows:
516+
example looks as follows:
517517

518518
```erlang
519519
#{id => ch3,

0 commit comments

Comments
 (0)