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!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!decvax!mit-athena!jc From: jc@mit-athena.UUCP (John Chambers) Newsgroups: net.lang.c Subject: Re: Re: Can #define `token-string' be empty? Message-ID: <89@mit-athena.UUCP> Date: Tue, 26-Feb-85 11:29:18 EST Article-I.D.: mit-athe.89 Posted: Tue Feb 26 11:29:18 1985 Date-Received: Fri, 1-Mar-85 07:20:04 EST References: <1914@uvacs.UUCP> Organization: MIT Project Athena Lines: 40 > C source: Output from preprocessor: > =================================== ======================================= > #include ... (stuff from the include file here) > #define X > main() main() > { { > printf("This is X: %d\n",X); printf("This is X: %d\n",); > } } > Clearly, X was not considered to be 1 (or anything), and when I attempted to > used the test #if X == 1, the preprocessor complained of syntax error (since > it translated the line into #if == 1 . This is a good example of something I wish language implementors would learn to get right. X was considered to be something. X is exactly what the definition says: a null string; an empty string; a string of length 0. About 1500 years ago, there was a great advance in European mathematics when they learned from the Arabs about the number zero. Previous to this, zero was not considered to be a number, because it "didn't represent anything". What some Arab genius realized is that, actually, zero is a number which "represents nothing". There is a very important distinction here. Without a symbol for nothing, you can't even have a balanced budget! Character strings can be null. To say that X is a null string is not to say that X doesn't represent anything; it is to say that X represents nothing. These phrases are not equivalent; the first leads to confusions like people on the net are having, as well as to compilers that make funny irregular special cases out of "missing" tokens; the second leads to the useful understanding that a symbol may usefully appear in text without representing anything in the end result. Without this ability, we can't even have comments! One of the real pains in using lots of software is that so many programmers haven't caught on to this 1500-year-old idea that it is useful to have a symbol that represents nothing. As a result, we have all these library routines that fail when an argument is zero; we have compilers that do funny things when symbols are missing; etc. How can we go about teaching all the worlds' programmers about this very useful concept? John Chambers