[fpc-devel] Functors

Michael Van Canneyt michael at freepascal.org
Sun Dec 26 17:21:06 CET 2021



On Sun, 26 Dec 2021, Ryan Joseph via fpc-devel wrote:

>
>
>> On Dec 26, 2021, at 3:50 PM, Michael Van Canneyt via fpc-devel <fpc-devel at lists.freepascal.org> wrote:
>> 
>> I think the idea of using a fixed member identifier for special purposes is really
>> stupid design. I'll never forgive Embarcadero their 'GetEnumerator' idea...
>
> I'm 99% certain using the method name "Invoke" would be rejected on the grounds of backwards compatibility.
>
> Adding a new syntax using "default" like "function Add9(const N: Integer):
> Integer; default;" would probably  be rejected on the grounds that it's
> new syntax alone (that is default is only used with properties currently).

Why ? I'm proposing it. As far as I'm concerned, it is the way to go.

You could use it to easily promote a method to default on existing calls.

Michael.


More information about the fpc-devel mailing list