Path: utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!bloom-beacon!gatech!udel!burdvax!ubbpc!wgh
From: wgh@ubbpc.UUCP (William G. Hutchison)
Newsgroups: comp.lang.c++
Subject: Re: goodbye cpp ??? (macros vs. inline functions)
Summary: not a general solution
Message-ID: <423@ubbpc.UUCP>
Date: 6 Dec 88 15:47:19 GMT
References: <6590072@hplsla.HP.COM> <1757@dataio.Data-IO.COM> <3637@pt.cs.cmu.edu> <72227@felix.UUCP>
Organization: UNISYS CS, Blue Bell, PA
Lines: 21

In article <72227@felix.UUCP>, art@felix.UUCP (Art Dederick) writes:
> Conditional compilation without cpp:
> 
> const UNIX = TRUE; const MSDOS = FALSE;
> 
> if (UNIX) { 		/* code for UNIX systems only */
> } else if (MSDOS) {  	/* code for MSDOS systems only */
> }
> The compiler could dump the code for the constant conditional ... FALSE ...

No, this does not solve the general case.
What if "/* code for UNIX systems only */" includes function definitions?
C and C++ are not fully nested like Algol, Pascal, etc.:
function definitions may not occur within blocks.

So your proposal loses some important semantics of #ifdef ... #endif.
-- 
Bill Hutchison, DP Consultant	rutgers!liberty!burdvax!ubbpc!wgh
Unisys UNIX Portation Center	"What one fool can do, another can!"
P.O. Box 500, M.S. B121		Ancient Simian Proverb, quoted by
Blue Bell, PA 19424		Sylvanus P. Thompson, in _Calculus Made Easy_