Making a function
The implementation currently just has the ability to transfer the control flow to a different operation tree. While it would be possible to represent a lot of different problems in this way, there are other capabilities that we normally associate with a function:
- Executing a sequence of statements
- Interrupting the control flow to leave the function immediately
- Using variables and defining how their names are scoped
So far, every operation only executes once, and the shape of the execution is known by the static type of the argument tuple for the operator. Let’s look at the following example in Python:
print("Hello")
print("World!")
If we were to translate that into an operation tree, it would look something like this:

Figure 11.3: Operation tree for a sequence of statements
But if we tried to describe the “statement sequence” operator in the code as it is now, we would...