[fpc-pascal] Proper preprocessor?

Michael Van Canneyt michael at freepascal.org
Wed Jun 20 10:50:33 CEST 2018



On Wed, 20 Jun 2018, Ryan Joseph wrote:

> Are there any plans to make a proper preprocessor like #define in C?  I’m
> not saying this is good programming practice or anything but I just had a
> really annoying copy and paste chore on some temporary code which I could
> have easily accomplished if I had #define like in C.  It’s such a trivial
> thing to add I wonder why it was never included in Pascal.

Because it is simply a bad idea ?

Pascal has some trivial macro support. {$define m:=xyz}

If you need more than that, you can use m4 or so. Lazarus has support for
pre-compile commands, so you can always configure it to preprocess your
files if you are so inclined.

Michael.


More information about the fpc-pascal mailing list