Re: [fpc-pascal] Double finalize

2023-12-20 Thread Nikolay Nikolov via fpc-pascal
On 12/21/23 07:06, Hairy Pixels via fpc-pascal wrote: On Dec 21, 2023, at 6:11 AM, Hairy Pixels wrote: Maybe I misunderstood but I thought they were supposed to be balanced with init calls. Is it the design of the compiler to allow multiple finalize calls and have the user keep track of it

Re: [fpc-pascal] Double finalize

2023-12-20 Thread Nikolay Nikolov via fpc-pascal
On 12/21/23 01:11, Hairy Pixels via fpc-pascal wrote: On Dec 21, 2023, at 1:53 AM, Michael Van Canneyt via fpc-pascal wrote: If you look at the generated code, you see that there is an implicit try/finally block and the finally block does a finalize. Maybe I misunderstood but I thought t

Re: [fpc-pascal] Double finalize

2023-12-20 Thread Hairy Pixels via fpc-pascal
> On Dec 21, 2023, at 6:11 AM, Hairy Pixels wrote: > > Maybe I misunderstood but I thought they were supposed to be balanced with > init calls. Is it the design of the compiler to allow multiple finalize calls > and have the user keep track of it the underlying structure is really > finalize

Re: [fpc-pascal] Double finalize

2023-12-20 Thread Hairy Pixels via fpc-pascal
> On Dec 21, 2023, at 1:53 AM, Michael Van Canneyt via fpc-pascal > wrote: > > If you look at the generated code, you see that there is an implicit > try/finally block > and the finally block does a finalize. Maybe I misunderstood but I thought they were supposed to be balanced with init c

Re: [fpc-pascal] string-type

2023-12-20 Thread Adriaan van Os via fpc-pascal
Adriaan van Os via fpc-pascal wrote: Section 3.2.4 of the FreePascal Language Reference defines string-type = "STRING" [ "[" unsigned-integer "]" ] | "TYPE" ( "STRING" | "ansistring" ) "(" unsigned-integer ")" . Ansistring is shown in the syntax diagram in boldface and thus as a keyword

Re: [fpc-pascal] Double finalize

2023-12-20 Thread Michael Van Canneyt via fpc-pascal
On Wed, 20 Dec 2023, Hairy Pixels via fpc-pascal wrote: I feel like this was addressed but I couldn't find any references. The program below prints the following: Initialize Create Finalize Finalize Why is Finalize called twice? I thought those were supposed to be called in pairs with

[fpc-pascal] string-type

2023-12-20 Thread Adriaan van Os via fpc-pascal
Section 3.2.4 of the FreePascal Language Reference defines string-type = "STRING" [ "[" unsigned-integer "]" ] | "TYPE" ( "STRING" | "ansistring" ) "(" unsigned-integer ")" . Ansistring is shown in the syntax diagram in boldface and thus as a keyword. But it is not listed as either a modifi

[fpc-pascal] Double finalize

2023-12-20 Thread Hairy Pixels via fpc-pascal
I feel like this was addressed but I couldn't find any references. The program below prints the following: Initialize Create Finalize Finalize Why is Finalize called twice? I thought those were supposed to be called in pairs with initialize? == {$mode objfpc} {$modeswi