> On Apr 27, 2021, at 9:58 AM, Michael Van Canneyt <mich...@freepascal.org> 
> wrote:
> 
> Wait.
> 
> I asked Sven to make sure that nested functions are under ALL circumstances
> usable as closures or can be used instead of anonymous functions.
> 
> Pas2js already supports this, and I want FPC and Pas2JS to be compatible in
> this regard.
> 
> So as Sven wrote, you would be duplicating effort, needlessly, since it has
> to work always... If the compiler can decide that the heap interface is not
> needed and optimize it away: so much the better. But I doubt this will be
> possible.

Maybe we're misunderstanding each other then. I'm responding to Sven when he 
says:

> Getting rid of the interface only works in very narrow circumstances that are 
> so seldom in real world code that it is not worth the effort.


I.e. all closures will be interface based because there are not enough real 
world use cases to support any alternative. Which is contrary to what you're 
saying that nested functions/closure will be compatible types. Sven can clear 
this up for us I guess.

Regards,
        Ryan Joseph

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

Reply via email to