contentsconceptssyntaxlibrariessampleserrorsindex
Full text search
Order of evaluation
Prerequisite Concepts      

The components of OmniMark actions and operators are evaluated in order, from left to right, and the action or operator is performed only after all its components (arguments) have been evaluated.

In particular, this means that the side effects of functions called during the evaluation of an action occur in the lexical order of the function calls in the action.

More particularly, the order of evaluation of the components of an action, operator or function call is as follows:

These steps are applied recursively to the component expressions of an action, operator or function call, as those component expressions are evaluated.

The first and third stages are those at which function side effects may occur.

The reason for this order of evaluation is to constrain the places at which checks for non-existent shelf items need be done. Note that a side effect of a function may be to create or delete a shelf item.

In this example:

  set counter target item f1 to f2
  1. f1 is called.
  2. f2 is called.
  3. an item of counter target is selected using the result of f1 as an item number.
  4. The selected item's value is set to the result of f2.

As a consequence of this left-to-right evaluation, the selected item may not exist prior to the set (or "set counter") action, but actually be created by either "f1" or "f2". It could even be removed by "f1" and recreated by "f2".

Note that programming in this style is generally deprecated.

Prerequisite Concepts
     Arithmetic and comparison operators
   Functions: argument classes
 
   
----

Top [CONTENTS] [CONCEPTS] [SYNTAX] [LIBRARIES] [SAMPLES] [ERRORS] [INDEX]

Generated: April 21, 1999 at 2:00:50 pm
If you have any comments about this section of the documentation, send email to [email protected]

Copyright © OmniMark Technologies Corporation, 1988-1999.