[net.unix-wizards] if ambiguity

geo (09/24/82)

I can't claim credit for this, I saw something like it
in someone else's code.  And of course it is not a very elegant
solution.

If your concern is that the trailing semicolon following
your macro would mess you up if you meant your macro
to be the only statement following an if you could always
define your macro

	#define mymacro	{ if (e1) s1; } else
rather than
	#define mymacro	{ if (e1) s1; }

	if (e2)
		mymacro;
	else
		s2;

This expands to:
	if (e2)
		{ fi (e1) s1; } else ;
	else
		s2

Which is both syntactically correct,
and, I believe what you wanted to say.