[fpc-devel] Macro Processing

Joerg Schuelke joerg.schuelke at gmx.de
Tue May 17 12:46:35 CEST 2011


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

> Why not to create something like:
> 
> *macro* Macro_Name(Param)
> *begin*
> *end*;
> 
> The Pascal way ? It's more readable. But then what do you gain with
> that Macro ?

-Doing it this way would not be acceptable by any developer, therefor
 tactical reason to suggest it like I did, remember even Florian wrote,
 he could live with that - and that is a big plus -!

-The way to write it is almost only syntactical sugar (feel free to
 implement a concept as you like and can)

-The comment parenthesis for all low level pascal behavior changing
 things is commonly accepted

-I did not try to extend pascal - new tokens, grammar all that

-The kind of writing you suggest (ironically) lets pretend a macro is
 like a pascal procedure, but it is not. Macro works so completely
 different from pascal, that it makes no clue for me, to let it
 look like an procedure.

Last days where much rumor, so I did not find the time to answer that
special question, here it is.

The gains are always the same: To do some things which could not be
done that easy in an other way!

Lets purpose you have an idea to extend the pascal syntax and you want
to check out, how it works, which problems it brings...
Maybe you decide to implement it with a macro and play around with it.
Then if you are ready with it you ask development: Look it works pretty
as a macro, if we incorporate it (into the language) this way there will
be no harm. You can have two or three different approaches this way,
without even touching the compiler.
But I am not that crazy, to bring that argument by myself, because this
is the most common fear, to bring up the possibility to change the
language and so ...

	Jörg



More information about the fpc-devel mailing list