Parameter Transfer Direction

Perhaps the simplest issue is that of parameter transfer direction. Parameters of functions declared in AIL are categorized as being of type in, out or in out (the same distinction as made in Ada). Python only has call-by-value parameter semantics; functions can return multiple values as a tuple. This means that, unlike the C back-end, the Python back-end cannot always generate Python functions with exactly the same parameter list as the AIL functions.

Instead, the Python parameter list consists of all in and in out parameters, in the order in which they occur in the AIL parameter list; similarly, the Python function returns a tuple containing all in out and out parameters. In fact Python packs function parameters into a tuple as well, stressing the symmetry between parameters and return value. For example, a stub with this AIL parameter list:

(*, in int p1, in out int p2, in int p3, out int p4)
will have the following parameter list and return values in Python:
(p1, p2, p3)  ->  (p2, p4)