[fpc-devel] Pure function development

Sven Barth pascaldragon at googlemail.com
Wed Apr 29 07:42:53 CEST 2020


Am 29.04.2020 um 00:31 schrieb J. Gareth Moreton:
> Hi everyone,
>
> I'm having a serious bash at developing pure functions for FPC now, 
> specifically 'node emulation' so it can step through a pure function 
> and compute output values.  One of the small problems I'm trying to 
> solve is keeping track of the state of variables, some of which are 
> record types or otherwise non-standard (e.g. _m128). Just before I 
> develop something that isn't cross-platform, is it acceptable to use 
> GetMem (and the use of pointers) and TVarRec on all platforms? (note 
> I'm using TVarRec, not the Variant type).

As I assume you mean inside the compiler, then yes, those are features 
that can be considered available on systems the compiler works on. 
Though you'll have to check whether TVarRec is the right choice for you 
(no, definitely not Variant!), because due to Delphi compatibility it 
does not contain a LongWord field. Maybe instead you'll want to use 
something like TConstValue or some new record that contains the 
necessary information? How do you plan to use it, that might give enough 
hints to decide what to do?

Regards,
Sven


More information about the fpc-devel mailing list