<< §4.3 Base calls | ↑ Table of Contents ↑ | §4.5 Lifting and lowering >> |
§4.4 Callin parameter mapping
(a) General case parameter mapping
The rules for mapping callin parameters and result type
are mainly the same as for callout bindings (§3.2)
except for reversing the ->
and <-
tokens and
swapping left hand side and right hand side.
Callin bindings using before
have no result mapping.
For result
in after
callin bindings
see §4.4.(c) below.
(b) Restrictions for callin replace bindings
The right-hand side of a parameter mapping may either be
the simple name of a base method argument without further computation,
or an arbitrary expression not containing any base method argument.
Each base method argument must either appear as a simple name in exactly one parameter mapping
or not be mapped at all. In the latter case, the original argument is "tunneled" to
the base call, meaning, the callin method does not see the argument, but it is passed
to the base method as expected.
If the base method declares a result, then
- if the role method also declares a result,
result
must be mapped to itself:result -> result
- if the role method does not declare a result, an arbitrary expression may be mapped to result:
expression -> result
If in this situation no result mapping exists, the result of the base call is "tunneled" and passed to the original caller (see fragile callin binding (§4.3.(e)) above).
These rules ensure that these bindings are reversible for the sake of base calls (§4.3).
As stated above a fragile callin binding (§4.3.(e)) is not allowed with a callin method that definitely has no base call (§4.3.(b)). A callin replace binding is not fragile if it provides the base result using a result mapping.
A callin method bound with replace to a base method returning void must not declare a non-void result.
(c) Mapping the result of a base method
In an after
callin binding, the right-hand side
of a parameter mapping may use the identifier result
to refer to the result of the base method.
An after
callin binding
can, however, not influence the result of the base method,
thus mappings with the ->
token are not allowed for after callin bindings.
For before
mappings using the ->
token is already ruled out by §4.4.(a)
(d) Multiple base methods
A callin binding listing more than one base method may use parameter mappings with only the following restriction: if any base parameter should be mapped this parameter must have the same name and type in all listed base method designators. However, different parameter mappings for different base methods bound to the same role method can be defined if separate callin bindings are used.
<< §4.3 Base calls | ↑ Table of Contents ↑ | §4.5 Lifting and lowering >> |