[fpc-devel] comparing methods

Mattias Gärtner nc-gaertnma at netcologne.de
Thu Sep 10 15:25:09 CEST 2009


Zitat von Jonas Maebe <jonas.maebe at elis.ugent.be>:

>
> On 10 Sep 2009, at 14:01, Mattias Gärtner wrote:
>
>>>
>>> Mattias Gärtner wrote:
>>>> Can someone explain why in mode objfpc comparing methods only compares
>>>> the address, but not the instance?
>>>
>>> Seems perfectly logical to me (@ = Address of, in this case "code
>>> address", the code is the same for all instances of a class).
>>
>> OnClick:=@MyClick;
>>
>> The @ operator is more than "address of".
>
> The current behaviour has been there since svn revision 1, so it's  
> quite old and established at least (and Delphi/TP-compatible, afaik).

Yes, and since the beginning I was wondering why. Years ago I thought,  
there are probably cases where this is useful. But since today I  
hardly saw one. OTOH I saw several times code that misused it.
If it is only for delphi/tp compatibility, then maybe it can be  
changed in mode objfpc?


Mattias




More information about the fpc-devel mailing list