Skip to content

Commit c640b8c

Browse files
authored
Merge pull request #49 from sourceryinstitute/update-example-readme
doc(example/README): improve language
2 parents e3f8e02 + 28a11f5 commit c640b8c

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

example/README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
Smart-Pointers Example
22
======================
33

4-
The [user_object_smart_pointer.f90] demonstrates the use of the
5-
Smart-Pointers library. The file contains
4+
The [user_object_smart_pointer.f90] file demonstrates the use of Smart-Pointers,
5+
including
66

7-
* A module that defines a `user_object_t` and `user_object_ptr_t` types,
8-
* A submodule defining a constructor funciton and a `free` final subroutin,
9-
* A main program with a `block` construct that forces finalization of
10-
the `user_object` entity declared in the main program.
7+
* A module that defines `user_object_t` and `user_object_ptr_t` types,
8+
* A submodule defining a constructor funciton and a `free` final subroutine,
9+
* A main program with a `block` construct that causes finalization of
10+
the `user_object` when the program reaches the `end block` statement.
1111

1212
This example exhibits several important subtleties:
1313

1414
1. Smart-Pointers automate object finalization, eliminating the need
15-
for `allocatable` objects.
15+
for `allocatable` objects.
1616
2. The main program source-allocates a raw `user_object` pointer and
1717
then passes the pointer to a `user_object_ptr_t()` constructor.
1818
3. The `user_object_ptr_t()` constructor nullifies the received pointer
1919
to encourage the intended practice in which all pointers associated
2020
with the object are reference-counted pointers.
2121
4. All assignments in the main program and its internal subroutine
22-
perform shallow copies, thereby creating new references to one object
23-
without copying the object.
22+
perform shallow copies, thereby creating new references to
23+
`user_object` without copying the object.
2424

25-
Running the example with the following command:
25+
Run the example as follows:
2626
```
2727
fpm run --example user_object_smart_pointer --compiler nagfor --flag -fpp
2828
```
29-
should produce the following output:
29+
which should produce the following output:
3030
```
3131
Allocating user_object pointer.
3232
Defining smart_pointer_1.

0 commit comments

Comments
 (0)