> On Nov 15, 2018, at 11:30 PM, Sven Barth via fpc-pascal 
> <fpc-pascal@lists.freepascal.org> wrote:
> 
> No, too many ways to do the same thing don't make things easier, not to 
> mention that everything needs to be maintained. So this gets a definite "no" 
> from me. 
> 
> Also the overhead for calling an anonymous function is only that for a 
> virtual method call. 

Do you mean if the anonymous function has no state it’s only a single function 
call?

After reading old forum posts it sounded like this was going to be implemented 
by some reference counted structure which was allocated on the heap and even 
using interfaces perhaps. Depending on how this is implemented it may not be 
possible to prevent them from capturing state if the anonymous function 
accesses variables in the parent scope.

How much of that is accurate?

Regards,
        Ryan Joseph

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to