Re: [fpc-pascal] Fwd: What to do to get new users

2025-01-23 Thread Santi via fpc-pascal
El 16/10/2024 a las 19:03, Guillermo Martínez Jiménez via fpc-pascal escribió: Prease DON'T add garbage collector. IMO it isn't a good idea. I had very bad experiences with it. Unless somebody found a new magic algorithm in the last decade... El Wed, 16 Oct 2024 04:49:44 -0700 Hairy Pixels via

Re: [fpc-pascal] Compile errors

2025-01-23 Thread Frank McCormick via fpc-pascal
On 2025-01-21 10:15, Michael Van Canneyt via fpc-pascal wrote: On Tue, 21 Jan 2025, Frank McCormick via fpc-pascal wrote: On 2025-01-21 09:00, Michael Van Canneyt via fpc-pascal wrote: On Mon, 20 Jan 2025, Frank McCormick via fpc-pascal wrote: I have been trying out a CRT replacement

[fpc-pascal] Inlined functions from compiled units

2025-01-23 Thread Hairy Pixels via fpc-pascal
Is the compiler actually able to inline functions which are used from a unit? When a unit is used it’s compiled to a .o file and linked so the compiler doesn’t have access to the source code anymore and thus can’t inline I would think. I write this because I’ve recently learned of link-time optimi

Re: [fpc-pascal] Fwd: What to do to get new users

2025-01-23 Thread Hairy Pixels via fpc-pascal
On Jan 24, 2025 at 2:10:53 AM, Santi via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > procedure foo() > var > s1: TStringList; > s2: TStringList; > s3: TStringList; > begin > s1:=TStringList.create; > try >s2:=TStringList.create; >try > s3:=TStringList.create; > t

Re: [fpc-pascal] Fwd: What to do to get new users

2025-01-23 Thread Nikolay Nikolov via fpc-pascal
On 1/24/25 7:16 AM, Hairy Pixels via fpc-pascal wrote: On Jan 24, 2025 at 11:20:02 AM, Nikolay Nikolov via fpc-pascal wrote: As you can see, it's more complicated and more error prone. You can simplify it a little bit with goto, but it will never be better, compared to try...finally ok, I

Re: [fpc-pascal] Fwd: What to do to get new users

2025-01-23 Thread Nikolay Nikolov via fpc-pascal
On 1/24/25 8:12 AM, Hairy Pixels via fpc-pascal wrote: On Jan 24, 2025 at 12:43:51 PM, Nikolay Nikolov via fpc-pascal wrote: That's not what exceptions are meant to be used for, though. What you describe is called a program "defect". When you encounter a "defect" in your program, you terminat

Re: [fpc-pascal] Inlined functions from compiled units

2025-01-23 Thread Sven Barth via fpc-pascal
Hairy Pixels via fpc-pascal schrieb am Fr., 24. Jan. 2025, 02:17: > Is the compiler actually able to inline functions which are used from a > unit? When a unit is used it’s compiled to a .o file and linked so the > compiler doesn’t have access to the source code anymore and thus can’t > inline I

Re: [fpc-pascal] Fwd: What to do to get new users

2025-01-23 Thread Nikolay Nikolov via fpc-pascal
On 1/24/25 8:38 AM, Hairy Pixels via fpc-pascal wrote: On Jan 24, 2025 at 1:34:26 PM, Nikolay Nikolov via fpc-pascal wrote: Doesn't matter whether they're handled in the same scope or not. It's the same code. Usually they're not handled in the same scope, but in a very distant place. That's u

Re: [fpc-pascal] Fwd: What to do to get new users

2025-01-23 Thread Hairy Pixels via fpc-pascal
On Jan 24, 2025 at 11:20:02 AM, Nikolay Nikolov via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > As you can see, it's more complicated and more error prone. You can > simplify it a little bit with goto, but it will never be better, compared > to try...finally > > ok, I’ve never used exc

Re: [fpc-pascal] Fwd: What to do to get new users

2025-01-23 Thread Sven Barth via fpc-pascal
Hairy Pixels via fpc-pascal schrieb am Fr., 24. Jan. 2025, 06:16: > Feels to me like manual memory management and exceptions don’t mix well. I > use exceptions in C# and Swift and they don’t require all this boiler plate > to prevent memory leaks. > Don't know about Swift, but C# uses garbage co

Re: [fpc-pascal] Fwd: What to do to get new users

2025-01-23 Thread Hairy Pixels via fpc-pascal
On Jan 24, 2025 at 12:43:51 PM, Nikolay Nikolov via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > That's not what exceptions are meant to be used for, though. What you > describe is called a program "defect". When you encounter a "defect" in > your program, you terminate the program. The

Re: [fpc-pascal] Fwd: What to do to get new users

2025-01-23 Thread Hairy Pixels via fpc-pascal
On Jan 24, 2025 at 1:34:26 PM, Nikolay Nikolov via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > Doesn't matter whether they're handled in the same scope or not. It's the > same code. Usually they're not handled in the same scope, but in a very > distant place. That's usually when except

Re: [fpc-pascal] Fwd: What to do to get new users

2025-01-23 Thread Nikolay Nikolov via fpc-pascal
On 1/24/25 3:21 AM, Hairy Pixels via fpc-pascal wrote: On Jan 24, 2025 at 2:10:53 AM, Santi via fpc-pascal wrote: procedure foo() var  s1: TStringList;  s2: TStringList;  s3: TStringList; begin  s1:=TStringList.create;  try    s2:=TStringList.create;    try s3:=TStringList.create;      tr

Re: [fpc-pascal] Fwd: What to do to get new users

2025-01-23 Thread Nikolay Nikolov via fpc-pascal
On 1/24/25 4:04 AM, Hairy Pixels via fpc-pascal wrote: On Jan 24, 2025 at 8:38:25 AM, Nikolay Nikolov via fpc-pascal wrote: Maybe because there's a much better way to write it: procedure foo(); var   s1: TStringList = nil;   s2: TStringList = nil;   s3: TStringList = nil; begin   try     s1:=

Re: [fpc-pascal] Fwd: What to do to get new users

2025-01-23 Thread Hairy Pixels via fpc-pascal
On Jan 24, 2025 at 8:38:25 AM, Nikolay Nikolov via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > Maybe because there's a much better way to write it: > > procedure foo(); > var > s1: TStringList = nil; > s2: TStringList = nil; > s3: TStringList = nil; > begin > try > s1:=TStr