imperative / any
Analogy
Collected by Benedict du Boulay — Own practice
Provides a way to visualise input and action, and later the difference between action and output. The same visualisation extended to cover user defined procedures, parameters and later to explain sub-procedure calls including recursion.
PL | NM |
---|---|
procedure | worker who knows how to do a particular job |
procedure call | calling the name of the worker, so that he starts doing his particular job |
procedure input | giving information to the worker (telling them in their right ear) |
procedure implementation | instructions for the worker on how to do their job |
procedure effect | how the worker affects the world |
procedure result | what the worker speaks to the worker on their left |
This notional machine was used in the following report:
DAI Occasional Paper No.4 (pp. 1-145), 1976
Each procedure is like a worker who knows how to do a particular job and will execute that job when commanded to by having his name called.
Some of these workers need information to be able to do their jobs. Giving this information is called giving an input.
We have described procedures as workers. So far all the workes have been run because they produce some effect. In most cases the effect has depended on an input.
They always listen for their input from the right. The workers will only carry out their effect once they have the correct number of inputs.
There are other kinds of workers which do not produce an effect.
These workers use their inputs to calculate a result which they speak to the worker on their left.
We are unable to see this result unless we arrange for it to be the input of a worker who produces a visible effect.
The name of a procedure which only gives a result is ADD
.
Do you have feedback on this notional machine? Did you find a mistake, or do you have a request for improvement? You can create an Issue on GitHub, where the description is hosted. This way we can see your feedback and address it.
For this, you need a GitHub account. Then follow this link to see the source file of this page. In there, click the ... left of the highlighted line, then pick "Reference in a new issue".