Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site mit-athena.UUCP Path: utzoo!utcs!lsuc!pesnta!amdcad!decwrl!decvax!mit-athena!jc From: jc@mit-athena.UUCP (John Chambers) Newsgroups: net.lang.c Subject: Re: Can #define `token-string' be empty? Message-ID: <88@mit-athena.UUCP> Date: Mon, 25-Feb-85 12:13:54 EST Article-I.D.: mit-athe.88 Posted: Mon Feb 25 12:13:54 1985 Date-Received: Wed, 27-Feb-85 06:20:11 EST References: <169@redwood.UUCP> Organization: MIT Project Athena Lines: 34 +--------------- | > Is | > #define X | > valid, i.e., can the `token-string' mentioned on page 207 of K&R be empty? | Yes. the default value of X is 1. | larry... | uucp: ..mit-eddie!cybvax0!cci-bdc!larry | arpa: henrik@mit-mc.ARPA +--------------- Gee, I hope not. This would undercut the following: #define then #define begin { #define end } ... if (foo) then begin ... end else begin ... end Now, maybe you like C's syntax. I know I prefer it to the wordier form in this example. But there's really no reason other than taste (about which there is an ancient Roman saying; I betcha you know it) to object to this. I have even used tricks like this to make the C preprocessor do 90% of the work of "translating" programs to C. If #define didn't work correctly, I'd have to do something kludgy like #define then /**/ which I'd rather not do on general principal. On a more general ground, I'd much prefer the first #define above to behave literally ("Replace 'then' with nothing at all.") than to have the preprocessor make some sort of special case out of it. If I wanted "then" to be "1", I'd rather say so explicitly. Let's keep C reasonably simple. It makes my job easier. John Chambers (one of several)