[fpc-devel] Macro Processing

Hans-Peter Diettrich DrDiettrich1 at aol.com
Fri May 13 16:19:21 CEST 2011


Florian Klaempfl schrieb:

> I really thing we should first collect use cases and maybe improve
> existing solutions if needed instead of opening another can.

ACK. Here a first example:

We often have enumerated types, with arrays of strings or other 
associated information, that must be kept in sync (array dimension and 
content). Macros with parameters would allow to create these tightly 
coupled declarations from a single piece of text, acting as a table from 
which the enum can be created from column 1, a name array from column 1 
or 2, a list of procedure pointers from column 3, etc.

While much can be done with an array of records, I badly miss a feature 
to create an enum from such an array. Ever hit an "number of elements 
differ" error, with no indication of which of the many enum elements 
have been added or removed? In the worst case the code will fail, when 
somebody only reordered the enum or array elements, without any compiler 
hint :-(


Another one:

Replacement of $IFs. (Around DebugLn...)

DoDi




More information about the fpc-devel mailing list