[fpc-pascal] Are there any drawbacks to "reference to"?

Sven Barth pascaldragon at googlemail.com
Mon Jun 20 17:11:29 CEST 2022


Hairy Pixels <genericptr at gmail.com> schrieb am Mo., 20. Juni 2022, 15:32:

> Can anyone explain why this works? TProc is a normal function pointer so
> how did it capture gVar? My understanding is that only nested proc vars
> could do this.
>

Globals don't need to be captured, because they're reachable from any scope.

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20220620/82683160/attachment.htm>


More information about the fpc-pascal mailing list