[fpc-devel] Functors

Ryan Joseph genericptr at gmail.com
Sun Dec 26 15:40:44 CET 2021



> 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).

I would say an operator would be most likely to be accepted, such as:

	class operator Call(....);

because it could be overloaded easily and doesn't present any new syntax.

Personally I like this idea but I tend to favor new syntaxes.

Regards,
	Ryan Joseph



More information about the fpc-devel mailing list