[fpc-devel] Macro Processing

Michael Van Canneyt michael at freepascal.org
Sat May 14 10:02:41 CEST 2011



On Sat, 14 May 2011, Joerg Schuelke wrote:

> Am Sat, 14 May 2011 00:36:17 +0200
> schrieb Jonas Maebe <jonas.maebe at elis.ugent.be>:
>
>> 1) the compiler automatically makes you keep them in sync, because
>> adding/removing an element form the enumeration will cause a
>> compilation error for the array if it's not updated
>> 2) the array can actually be removed at some time in the future, because FPC can
>> nowadays convert enumerations to their their name in string
>> representation (via str(), write() and writestr()). There are still
>> some bugs in this functionality in 2.4.x on some platforms though, so
>> it can't be used yet in the compiler
>
> 2) This is the solution? Making the compiler to store somewhere a
> string representation in my object file and then give it back to me if
> I request it by str(enumerate)??? Thats so completely ... overhead,
> with a cannon to shoot a sparrow. Since when has an enumeration such
> kind of name, which lives outside compile time?

Since always as soon as you use str() on it, or if it is in RTTI somewhere.

How do you think streaming works ?

Michael.



More information about the fpc-devel mailing list