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

2022-06-19 Thread Michael Van Canneyt via fpc-pascal
On Mon, 20 Jun 2022, Sven Barth via fpc-pascal wrote: Am 20.06.2022 um 03:37 schrieb Hairy Pixels: On Jun 19, 2022, at 10:04 PM, Sven Barth wrote: As you can see the allocation only happens once and not all the time. What might be worse however is the optimization behavior as in this e

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

2022-06-19 Thread Sven Barth via fpc-pascal
Am 20.06.2022 um 03:37 schrieb Hairy Pixels: On Jun 19, 2022, at 10:04 PM, Sven Barth wrote: As you can see the allocation only happens once and not all the time. What might be worse however is the optimization behavior as in this example the compiler wouldn't optimize the counter variable i

Re: [fpc-pascal] Calling undefined function pointers in generics

2022-06-19 Thread Hairy Pixels via fpc-pascal
NOTE: I’m replying to this and CC’ing Sven so hopefully he can see it. > On Jun 19, 2022, at 10:05 AM, Hairy Pixels wrote: > > This code snippet will give a compiler error "Syntax error, ";" expected but > "(“ found”. It’s an unspecialized generic type so I would think it should > compile and

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

2022-06-19 Thread Hairy Pixels via fpc-pascal
> On Jun 19, 2022, at 10:04 PM, Sven Barth wrote: > > As you can see the allocation only happens once and not all the time. > What might be worse however is the optimization behavior as in this example > the compiler wouldn't optimize the counter variable into a regvar with > enabled optimiz

[fpc-pascal] Functions for dealing with floating-point precision

2022-06-19 Thread Thomas Kurz via fpc-pascal
Hello, in my program I have need for checking floating-point precision. I'm internally using floating-points for calculations, but in the end I have to use integer numbers. I cannot use Round() because I have to check for thresholds. I.e. that I wish to accept a value of 1. as being ">=

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

2022-06-19 Thread Sven Barth via fpc-pascal
Hairy Pixels schrieb am So., 19. Juni 2022, 15:44: > > > > On Jun 19, 2022, at 7:01 PM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > As I can see neither Anthony's nor Ryan's mail, but I can see them in > the archive, I'll use Jonas mail for some general replies (

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

2022-06-19 Thread Hairy Pixels via fpc-pascal
> On Jun 19, 2022, at 7:01 PM, Sven Barth via fpc-pascal > wrote: > > As I can see neither Anthony's nor Ryan's mail, but I can see them in the > archive, I'll use Jonas mail for some general replies (please CC me when > replying): Firstly unrelated, I posted a question about generics which

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

2022-06-19 Thread Sven Barth via fpc-pascal
Jonas Maebe via fpc-pascal schrieb am So., 5. Juni 2022, 21:02: > On 2022-06-05 18:20, Anthony Walter via fpc-pascal wrote: > > > As the "reference to" feature was recently added to fpc trunk, I'd like > > to ask if internally there are any penalties (performance perhaps) or > > drawbacks to usin