[fpc-pascal] Proper preprocessor?
Sven Barth
pascaldragon at googlemail.com
Wed Jun 20 18:52:02 CEST 2018
Ryan Joseph <ryan at thealchemistguild.com> schrieb am Mi., 20. Juni 2018,
17:41:
>
>
> > 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’)
>
In Pascal you'd use inline functions for this one though of course with
strong typing and not some identifier that both a human and the IDE will
have to guess what it is.
Regards,
Sven
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20180620/dd613203/attachment.html>
More information about the fpc-pascal
mailing list