Markus Gerwinski wrote:
... snip ...
What's the point in declaring a local result variable in the unit interface?!? I mean, the code
Function bar = result: integer; begin (* bar *) ... end (* bar *);
is, in fact, nothing but an abbreviated way to write:
Function bar: integer; var result: integer; begin (* bar *) ... bar:= result; end (* bar *);
So `result` is actually a local variable, and no module using the unit will ever be able to access it. Why put it into the interface?
I'd definitely feel more comfortable if we could skip the standard here and permit the other syntax again...
My own attitude is that the use of result is pointless in the first place. It gains nothing that I can see over the standard method "bar := ...". In fact I like to code many things as:
FUNCTION foo : T
VAR anotherTvalue : T
BEGIN foo := someTvalue; (* default *) .... IF whatever THEN foo := anotherTvalue; .... END;
Please show me something that the traditional method can't do.