Skip to content

Commit 574e9ca

Browse files
rousonbonachea
authored andcommitted
add sentence about prohibition against I/O in pure procedures
1 parent aedbf4b commit 574e9ca

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ Specifically, the pure attribute conveys compliance with several constraints tha
5454
For a compiler, these constraints support optimizations, including automatic parallelization on a central processing unit (CPU) or offloading to a graphics processing unit (GPU).
5555
For a developer, the constraints support refactoring tasks such as code movement.
5656

57+
The Fortran standard prohibits input or output in pure procedures, which precludes a common debugging mechanism.
5758
A developer seeking output inside a procedure presumably has an expectation regarding what ranges of output values represent correct program execution.
5859
A developer can state such expectations in an assertion such as `call_assert(i>0 .and. j<0)`.
5960
Enforce the assertion by defining the `ASSERTIONS` macro when compiling.

0 commit comments

Comments
 (0)