[fpc-devel] Macro Processing

Joerg Schuelke joerg.schuelke at gmx.de
Mon May 16 11:23:11 CEST 2011

Am Mon, 16 May 2011 11:16:39 +0300
schrieb ik <idokan at gmail.com>:

> So what that I'm trying to say is that Macro in C and C++ are there
> as a hack to do things you can not do properly
> in any other way. And I can not find any real reason for using it in
> Pascal.

An macro represents the concept of automated text changing. Nothing

The answer was to use a logging facility? Maybe some kind of log
server, where a pascal import unit is avail?

Thats really very high level for that low level problem ;-(

This way you restrict the programmer!

My debug system gives me what I want:
- FILE info from build-in macro
- FUNC info from build-in macro (patched by myself)
- LINE info from build-in macro
- the additional info I request

And now it is time to say that a real discussion is not possible if you
always say: Yeah, you should not do that! Sounds like religion for me.

I remember:
An macro represents the concept of automated text changing. Nothing

If you want to criticize it, do it. And I do that to.
Did you see that your argument of macros are a hack to do things which
else not can be done in C, is easily turned around? Some things you do
the only-true-pascal-way are only dirty hacks, to prevent the use of an
macro. Because you do not have one.

For example the statement: Use a logging facility instead. If that
would be true, the compiler would use one. You would use one. Everybody
would use one, everytime.
But no, we mess around with that writeln thing and comments. Do not say
you did not, you did never.


More information about the fpc-devel mailing list