Action Specification

So far, we have talked about formula definitions without mentioning the updating actions (e.g. renew the display of the content of a variable when it is changed) since there is no default implicit action associated with each definition. However, EDEN provides a way of defining explicit actions. Thus the user can specify special updating actions for different devices. In the rest of this handbook, the term ``action'' refers to ``explicit action'' because it is the only kind of action available in EDEN.

The following statement illustrates a sample action definition.

proc display_v : v { display(v); }

The keyword ``proc'' defines an action, named as display_v, which invoked by the system when the value of variable v, (specified after the colon) is changed. The curly brackets {} enclose a list of statements to be executed sequentially. In this case, there is only one procedure call. The procedure display is defined separately. By calling different functions (with appropriate side-effects, e.g. writeln(...) prints the values of its arguments on the standard output) in the function libraries, display can do different updating actions. This makes EDEN more extensible.

Note that the value of v is not passed as a parameter to display_v when the action is invoked, but since it is a global variable, it can be accessed by the action directly.


[BACK] [HOME] [UP] [HELP]