From Peter Grogono's "Programming in PASCAL" Addison Wesley 1980, a statement is defined as:
In this diagram, I don't see how I can call the function as a statement; the only way to call it is to make a new temporary variable, then assign it with the desired function as an expression.
How can I call function without assigning the returning value?
After reading Pascal ISO 7185:1990 specs, I see that Pascal doesn't support function-statement
. So the only way to call them is by using temporary variables.
simple-statement =
empty-statement
| assignment-statement
| procedure-statement
| goto-statement