[fpc-pascal] Get variable name at runtime

Marco van de Voort marcov at stack.nl
Wed Mar 6 15:21:38 CET 2013


In our previous episode, Darius Blaszyk said:
> What
> preprocessor do you use then, M4?

Nearly always custom. With "general" I mean anything not part or integrated
with the compiler, not necessarily a known product.

The usage is now deceased and replaced by generics for the most.

> I'm curious to find out how you use an external preprocessor. 

Basically I defined an own source type (template), and the generator created
Pascal from that. The resulting code was compiled.

> In principle it's not a bad idea to use an external one.  I suggest we
> could also make it a bit more user friendly by providing some hooks in
> fpmake.  This way one should not nescesarily create additional scripts to
> copy files to other locations.  What do you think?

I think while not bad, this is premature. First usage of it (and reallife
experiences), and only then adapt the infrastructure to it.

But fpmake is easier customizable than the compiler of course. First we need
sb willing to massively work on it though :-)

> Please demonstrate how you use macro's in your perticular case.
> How do you adjust your build system. 

Not. I simply manually ran a batchfile that generated the makefiles. I was
too lazy to figure out msbuild for that (this was Delphi)



More information about the fpc-pascal mailing list