[fpc-pascal] Proper preprocessor?

Marco van de Voort marcov at stack.nl
Wed Jun 20 19:21:03 CEST 2018


In our previous episode, Ryan Joseph said:
> > On Jun 20, 2018, at 10:02 PM, Michael Van Canneyt <michael at freepascal.org> wrote:
> > 
> > Because it is a simple textual token replacement at present. Supporting arguments would mean parsing the macro, parsing whatever comes after it, matching the arguments etc. A whole added layer of complexity.
> 
> It?s like a simplified regular expression. Capture anything inside () on the left side and replace occurrences on the right side.
> 
> {$define hello(me) := writeln(?hello me')}
> 
> hello(world) becomes writeln(?hello world?)

That would be C incompatible, which I thought was the main reason to have
it?  It would also replace me in identifiers (like 'varwithme'), which C
afaik wouldn't without ##





More information about the fpc-pascal mailing list