Re: [fpc-pascal] Setting record values

2017-04-04 Thread Sven Barth via fpc-pascal
Am 04.04.2017 05:25 schrieb "Ryan Joseph" : > > Thanks for the tips, I appreciate it. > > This is all pretty trivial but it’s kind of annoying that using an inline class function is more efficient than a constructor despite having identical functionality. It's tempting to remove the constructors no

Re: [fpc-pascal] Setting record values

2017-04-03 Thread Ryan Joseph
Thanks for the tips, I appreciate it. This is all pretty trivial but it’s kind of annoying that using an inline class function is more efficient than a constructor despite having identical functionality. It's tempting to remove the constructors now and replace them with inline functions but it

Re: [fpc-pascal] Setting record values

2017-04-02 Thread Sven Barth via fpc-pascal
On 01.04.2017 09:59, Ryan Joseph wrote: > >> On Apr 1, 2017, at 2:46 PM, Sven Barth via fpc-pascal >> wrote: >> >> I haven't looked at it in detail, but it could be that both have similar >> efficiency. You could also add "inline" to the MakePoint function which >> should get rid of a potentia

Re: [fpc-pascal] Setting record values

2017-04-01 Thread Ryan Joseph
> On Apr 1, 2017, at 2:46 PM, Sven Barth via fpc-pascal > wrote: > > I haven't looked at it in detail, but it could be that both have similar > efficiency. You could also add "inline" to the MakePoint function which > should get rid of a potential temporary variable if the compiler doesn't do

Re: [fpc-pascal] Setting record values

2017-04-01 Thread Sven Barth via fpc-pascal
Am 01.04.2017 05:59 schrieb "Ryan Joseph" : > > I’ve been using a design pattern in my code which I think is probably pretty stupid so I’d like to make sure. Assume I have a type like TPoint below and I want to set the value I’ll doing something like point := PointMake(x, y). How does the compiler

[fpc-pascal] Setting record values

2017-03-31 Thread Ryan Joseph
I’ve been using a design pattern in my code which I think is probably pretty stupid so I’d like to make sure. Assume I have a type like TPoint below and I want to set the value I’ll doing something like point := PointMake(x, y). How does the compiler handle this? It probably has to allocate some