Closed valexey closed 11 years ago
Oh my... I would not interpret the report saying in this way but it seems like existing implementations (BlackBox) prohibit function calls as a statement. Is there at least one good practical point for this behavior?
No. In BlackBox:
MODULE Test;
PROCEDURE Test() : INTEGER;
BEGIN
RETURN 42;
END Test;
BEGIN
Test(); (* error: procedure call of a function *)
END Test.
I said the same thing - in BB it is prohibited (compiler error) :)
I think that according Oberon-07/11 report our compiler must prohibit function call as statement.
Still I wonder why do not write it clearly in report, e.g. "procedures returning result cannot be used as a statement". Instead of all of these "proper procedures" etc...
Fixed.
According #10 of Oberon 07/11 report:
So, procedure-function call can be only part of expression. But at current compiler realization such call can be treats as statement: