[fpc-devel] Initialize/Finalize management operators and Default intrinsic

Sven Barth pascaldragon at googlemail.com
Wed Apr 13 22:00:26 CEST 2016


On 13.04.2016 15:24, Maciej Izak wrote:
> 2016-04-12 17:15 GMT+02:00 Sven Barth <pascaldragon at googlemail.com
> <mailto:pascaldragon at googlemail.com>>:
> 
>     > Maybe "run" for my idea is a bad word. We don't need to run any section before initialization section from system. What we need is the table/list with "fixed" variables which needs to be initialized in system.pp initialization (and finalized in finalization). I think that is doable.
> 
>     It doesn't matter. You need to run the initializer operators and
>     these might rely on functionality that is not initialized yet. So
>     the safest approach would definitely be to init these after all
>     initialization sections and to document this and the reasons behind
>     it. This also alleviates the need to use attributes for this (or a
>     keyword or whatever).
> 
> Running the initializer operators after initialization is IMO bad
> idea... Very "pascal incompatible" and confusing even for me ;). I see
> many problems for that approach...
> 
> I think I have other solution (that also can help to solve old
> problems). What is needed is new section like "managementinitialization"
> and "managementfinalization" (to complement
> "initialization"/"finalization" with a little different logic).
> managementinitialization should contains only module related stuff
> (memory allocation etc.) mostly used/required by Initialize management
> operators without dependencies nor complex logic. How it supposed to
> work? Below is attached modified example presented by Thorsten Engler
> and modified example presented by Sven + my invention ;).

The code provided by Thorsten is sufficient (and needed for dynamic
packages anyway); an additional section is not needed, that just adds
unnecessary complexity for users.

Regards,
Sven




More information about the fpc-devel mailing list