next up previous contents index
Next: L-Values Up: Expressions and Operators Previous: The At Operator.

Procedure Calls

 

By default, parameters in ZPL are passed by value, which means that any modifications to the formal parameter do not affect the actual parameter. Note that this may be expensive because parameters may have to be copied to preserve ``call-by-value'' semantics. Parameters are passed by reference by prefixing the var keyword to the formal parameter declaration, in which case any modifications to a formal parameter will also affect its corresponding actual parameter. Below, the first parameter is passed by reference and the second is passed by value.

    procedure p (var A: [R] float; B: [R] float);
When nested data structures are passed by value, only the top-level is copied. For example, if a record is passed by value, the record itself is copied but its subfields are not.

  Recursion is allowed.



Kay Nettle
Fri Feb 21 21:14:29 CST 1997