Skip to main content Skip to navigation

Pre-defined variables

The following is a list of pre-defined read/write variables. The user should not alter the value of these variables, except autocalc.

stdin, stdout, stderr
These three variables are pre-defined file pointers equivalent to those file pointers in C. All of them are of integer type.
autocalc
If the value of autocalc is set to 0, the mechanism of auto-recalculate of formula definitions will be switched off. In such a situation, formulae and actions will not be recalculated or invoked when the values of those variables on which they are dependent are changed. However, when autocalc is set to a non-zero value, the auto-recalculation mechanism will be back in action. By default, autocalc is set to 1.
calc_list
In the earliest version of EDEN interpreter, the pointers pointing to the formula variable and action specifications are queued in the list variable calc_list. The interpreter would not update or invoke those queued formula variables and actions when autocalc is switched ``off''. The following action specification can update these queued formulae and actions automatically when autocalc is on again:
proc _autocalc : autocalc {
    while (calc_list#) {
        *calc_list[1];       /* update formula var's */
        shift calc_list;     /* remove from list */
    }
}

Note that this action will only be invoked when the auto-calculate mechanism is on (i.e. autocalc is non-zero). This action forces the formula variables to be updated by simply evaluating them (the interpreter always updates the formula variables if they are evaluated). Although this action does not invoke queued actions, the updating of the formula variables will cause the related actions to be invoked.

In the new version of EDEN interpreter, all queued formulae and actions would be updated and invoked as soon as the auto-recalculate mechanism is switched on. The references to the formula variables and action specifications are stored in an internal format and hence the variable calc_list is not needed. Thus the user cannot alter the list. To inspect the formula variable and action specification queues while autocalc is ``off'', the user can call the pre-defined functions, formula_list() and action_list(), which transform the internal information into Eden's list type.