It seems it would be hard to make Oberon the language to play well with "foreign" environments, such as the Java VM and the library. How does one implement interfaces, for example?
For example the Oberon definition below:
DEFINITION MathUtil;
PROCEDURE ln(x : REAL) : REAL;
END MathUtil.
exposes the Java MathUtil.ln() static method: public class MathUtil {
public static float ln(float x) {
return (float) java.lang.Math.log(x);
}
}
A client module can use now the Java implementation of ln: MODULE Client;
IMPORT MathUtil;
VAR x: REAL;
BEGIN
x: = MathUtil.ln(2.0);
MathUtil.ln()
END Client;
For a complete example see https://github.com/lboasso/oberonc/tree/master/examples/fern > DEFINITION
I am not sure, but would a MODULE only containing declarations (and no or empty body) also work, syntactically?