Eike Lange wrote (to me personally, forwarded here with his permission):
On Tue, Feb 06, 2001 at 12:36:03AM +0100, Frank Heckenbach wrote:
Should this be changed? Using parentheses, as Eike suggested, works, but perhaps it would be more convenient if the above works. OTOH, it would (slightly) reduce the functionality of macros since it would then not be possible to use unbalanced brackets in arguments (though this is probably not useful unless in very strange situations)...
Is there a standard available for writing macros with Pascal?
Nope. None of the various standards and de-facto standard specify macros at all, AFAIK, and I don't even know if any other Pascal compiler supports them. GPC's macros are basically taken from GCC, somewhat Pascal-ized (#define -> {$define}, support for case-insensitive macros, etc.)
If not, I would suggest to make this work with multidimensional arrays.
That was my first thought too (even though, as you have shown, it works using parantheses). OTOH, as Russ noted, "changing the rules might cause more problems then it solves". I'm not sure what to do...
I never thought that unbalanced expressions work with macros and IMO they decrease readability.
Definitely. (I personally think macros is general decrease readablility, but even more so for macros that don't contain complete syntactical items.)
Frank