[fpc-pascal] Creating capturers

Hairy Pixels genericptr at gmail.com
Sat Nov 4 01:41:54 CET 2023



> On Nov 3, 2023, at 8:31 PM, Sven Barth <pascaldragon at googlemail.com> wrote:
> 
> If you need a catch all type, then you should use function references. There is no need to invent yet another type.
> The only thing it can not handle is the assignment of nested function pointers (in contrast to nested functions directly), because they can only ever be used in a function that is below the one where the nested function was assigned which is not a guaranteed property for function references.
> 

not always because it creates a heap allocated interfaces for every function they're used in, even if it doesn't escape the scope. Maybe this was fine for Delphi but they can't be used for anything real time outside of GUI apps. 

Regards,
Ryan Joseph



More information about the fpc-pascal mailing list