Objects and structures may be defined dependent on other objects and structures, using the command depend. For example
- interpcom -> depend A prog B C
makes the object A dependent on B, C. Here prog is the name of a program. When the command
- interpcom -> update A
is executed, the same commands for B, C are executed, and then the program prog, with arguments A, B, C. Suppose for example that A, B, C are objects of the same type that are arrays of numbers, and that prog contains the following instruction
add #2 #3 #1
(i.e. it adds the second and third argument, and stores the result in the first). Then
- interpcom -> update A
will simply add B and C and put the result in A, if B and C do not depend on anything else. Suppose now that there is another object D, and we do
- interpcom -> depend B prog C D
then
- interpcom -> update A
will first update B, and then call prog. After that A will contain 2 times C plus D.
There is no verification that an infinite loop can occur (if an object depends on itself). The dependancy can be broken using the command
- interpcom -> undepend A