Hi Folks!
Frank Heckenbach wrote:
Markus Gerwinski wrote:
This results in a 'Header does not match previous definition' for function Bar.
Yes, according to the standard (*), the result variable must be present in the original declaration as well. GPC didn't check this before, but does now.
(*) This is only stated in the Object-Oriented Extensions, 6.7 (d):
: [...] and if one function definition contains a result variable : specification, then the other also has a result variable : specification of the same spelling.
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...
Regards,
Markus __________________________________________________________ Mit WEB.DE FreePhone mit hoechster Qualitaet ab 0 Ct./Min. weltweit telefonieren! http://freephone.web.de/?mc=021201