[fpc-devel] Interface scope incompatibility with Delphi

Michael Van Canneyt michael at freepascal.org
Wed Nov 10 11:24:52 CET 2010



On Wed, 10 Nov 2010, Graeme Geldenhuys wrote:

> Op 2010-11-10 11:56, Michael Van Canneyt het geskryf:
>>
>> Well, the original coders made assumptions which they're not supposed to make.
>
> To be fair, it has worked for over a decade already. Plus many IDE and
> Compiler add-on vendors implement their products based on Delphi behaviour
> (even though it might not all be documented). The same gets done for
> Windows apps in general - working on Windows behaviour. Lets not speculate
> if it will be broken or not in the next Delphi release (nobody knows the
> answer to that, and there is no reason why it will be broken then). All I
> am saying is that in the current "released" Delphi versions (at least down
> to D7, probably D6 too) this feature works. The "mouse cursor" trick using
> the same Interface behaviour has been in tiOPF code for years, and I think
> that's where I saw it first.
>
> And the fact that so many developers asked about Interface scope problems
> in the past [as you mentioned], clearly indicates that that should be the
> expected behaviour in FPC too.

As soon as it becomes spec, yes. Otherwise no.

Just like the 'const is passed by ref'. No, it is not, and won't be: it's up
to the compiler's dicretion.

>> Nowhere is the Delphi behaviour guaranteed, not even by Delphi.
>
> Well, I can always argue that FPC tries to clone/mimic Delphi behaviour in
> many ways... it's that little FPC design goal called "delphi
> compatibility". Think of all the poor developers trying to port their
> Delphi code to FPC.  ;-)

Yes, valid and documented code is supported. 
This is invalid code which just so happens to work.

There are more cases where we are incompatible. All of them for good reason.

Michael.



More information about the fpc-devel mailing list