I'm uncertain what exceptions I should allow for a callback function.
Since I don't know what exception the callback may raise I had to allow
ANY ? To take the example from
http://research.compaq.com/SRC/m3defn/html/procs.html
I had to declare
TYPE
Integrand = PROCEDURE (x: REAL): REAL RAISES ANY;
Integrator = PROCEDURE(f: Integrand; lo, hi: REAL): REAL RAISES ANY;
. Everyone who calls an Integrator has to provide a TRY..ELSE or <*FATAL
AY*> or RAISES ANY in turn, hm.
A similar problem is when the callback is not passed as parameter but
accessed through a generic module parameter. Then the callback function
may throw exceptions or not and this cannot be handled without warnings.
Example:
GENERIC MODULE IntegerPower(R);
PROCEDURE Power (x: T; y: CARDINAL): T =
....
pow := R.Mul(pow,pow);
....
where R.Mul can raise exceptions or cannot depending on what we assigned
to R.