[fpc-pascal] Proper preprocessor?
Ryan Joseph
ryan at thealchemistguild.com
Fri Jun 22 07:48:54 CEST 2018
> On Jun 22, 2018, at 12:21 PM, Michael Van Canneyt <michael at freepascal.org> wrote:
>
> 'Nice' is not an argument.
>
> If someone else assumes that assert() works as expected - i.e. throws an exception, then your macro will mess up his code, leading to
> unpredictable results.
>
> From my - admittedly subjective - point of view, your examples only serve to demonstrate why we should definitely not support macros...
For any example I can give it’s easy to extrapolate into some scenario where it would be a disaster. I get that. The reason I ever wanted to make a macro was for personal use to give some project specific meaning to some construct or a quick hack. Frameworks like Apple uses, often use macros to document parts of code in a way which otherwise isn’t part of the language and no suitable for comments. I’m not saying this is how we all should program. I don’t suggest people go out and start using macros in place of functions.
Btw why was the $define:= syntax ever introduced in the first place? adding a parameter to the syntax is a minor extension but it sounds like Pascal programers here really don’t like it in general.
Regards,
Ryan Joseph
More information about the fpc-pascal
mailing list