HP 3000 Manuals

PARTIAL_EVAL [ HP Pascal/iX Reference Manual ] MPE/iX 5.0 Documentation


HP Pascal/iX Reference Manual

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.



MPE/iX 5.0 Documentation