Re: [fpc-pascal] Why does nested function get corrupted?

2022-09-11 Thread Sven Barth via fpc-pascal
Ondrej Pokorny via fpc-pascal schrieb am So., 11. Sep. 2022, 15:29: > Am 11.09.2022 um 14:22 schrieb Sven Barth via fpc-pascal: > > Ondrej Pokorny via fpc-pascal schrieb > am So., 11. Sep. 2022, 12:18: > >> Shouldn't this assignment be forbidden? >> >> type >> TProc = procedure is nested; >>

Re: [fpc-pascal] Why does nested function get corrupted?

2022-09-11 Thread Ondrej Pokorny via fpc-pascal
Am 11.09.2022 um 14:22 schrieb Sven Barth via fpc-pascal: Ondrej Pokorny via fpc-pascal schrieb am So., 11. Sep. 2022, 12:18: Shouldn't this assignment be forbidden? type TProc = procedure is nested; function TestNested: TProc; begin result := procedure // why

Re: [fpc-pascal] Why does nested function get corrupted?

2022-09-11 Thread Sven Barth via fpc-pascal
Ondrej Pokorny via fpc-pascal schrieb am So., 11. Sep. 2022, 12:18: > Am 11.09.2022 um 11:26 schrieb Sven Barth via fpc-pascal: > > Hairy Pixels schrieb am Sa., 10. Sep. 2022, 03:21: > >> >> >> > On Sep 9, 2022, at 4:48 PM, Sven Barth >> wrote: >> > >> > How about you simply report such

Re: [fpc-pascal] Why does nested function get corrupted?

2022-09-11 Thread Ondrej Pokorny via fpc-pascal
Am 11.09.2022 um 11:26 schrieb Sven Barth via fpc-pascal: Hairy Pixels schrieb am Sa., 10. Sep. 2022, 03:21: > On Sep 9, 2022, at 4:48 PM, Sven Barth wrote: > > How about you simply report such corruptions as bugs? I can always close them as "not a bug" or duplicate if

Re: [fpc-pascal] Why does nested function get corrupted?

2022-09-11 Thread Sven Barth via fpc-pascal
Hairy Pixels schrieb am Sa., 10. Sep. 2022, 03:21: > > > > On Sep 9, 2022, at 4:48 PM, Sven Barth > wrote: > > > > How about you simply report such corruptions as bugs? I can always close > them as "not a bug" or duplicate if necessary. > > > > Well I thought the data may have been saved on the

Re: [fpc-pascal] Why does nested function get corrupted?

2022-09-09 Thread Hairy Pixels via fpc-pascal
> On Sep 9, 2022, at 4:48 PM, Sven Barth wrote: > > How about you simply report such corruptions as bugs? I can always close them > as "not a bug" or duplicate if necessary. > Well I thought the data may have been saved on the stack and thus lost when the function exits. What is the

Re: [fpc-pascal] Why does nested function get corrupted?

2022-09-09 Thread Sven Barth via fpc-pascal
Hairy Pixels via fpc-pascal schrieb am Fr., 9. Sep. 2022, 00:52: > Curious more than anything, if is nested captures state in a record and > passes it as an hidden self param, why does returning the variable and > calling from outside the calling stack frame corrupt the data? It seems > like it

[fpc-pascal] Why does nested function get corrupted?

2022-09-08 Thread Hairy Pixels via fpc-pascal
Curious more than anything, if is nested captures state in a record and passes it as an hidden self param, why does returning the variable and calling from outside the calling stack frame corrupt the data? It seems like it technically should be there. == type TProc =