HP Pascal/iX Reference Manual (31502-90022)

12- 61
Example
$PAGEWIDTH 80$
PARTIAL_EVAL
PARTIAL_EVAL is an HP Standard Option.
When the PARTIAL_EVAL compiler option is ON, the compiler produces code
that determines the value of each Boolean expression by evaluating the
minimum number of operands, from left to right. When the PARTIAL_EVAL
option is OFF, the compiler produces code that evaluates every operand of
each Boolean expression in an implementation dependent order.
Syntax
$PARTIAL_EVAL {ON }$
{OFF}
Default ON.
Location Statement.
The advantages of partial evaluation are more readable source code and
more efficient object code.
Examples
$PARTIAL_EVAL OFF$
IF (index IN [lower..upper]) AND
(ptr_array[index] <> NIL) AND
(ptr_array[index]^ = 5) THEN ...
In this first example, if
index
is out of range, then ptr_array[index]
causes a run-time error. If index is valid but ptr_array[index] is nil,
then ptr_array[index]^ causes a run-time error.
$PARTIAL_EVAL ON$
IF (index IN [lower..upper]) AND
(ptr_array[index] <> NIL) AND
(ptr_array^ = 5) THEN ...
In this second example, if index is out of range, then (ptr_array[index]
<> nil) is not evaluated. If ptr_array[index] is nil then (ptr_array^ =
5) is not evaluated.
$PARTIAL_EVAL OFF$
IF (index IN [lower..upper] THEN
IF (ptr_array[index] <> NIL) THEN
IF (ptr_array[index]^ = s) THEN ...
This third example is equivalent to the second example.
POP
POP is an HP Pascal Option.
The POP compiler option restores the compiler option settings that the
last PUSH option saved (with the exceptions listed below.)
Syntax
$POP$
Default Not applicable.
Location Anywhere.