Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site ucsfcgl.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!decvax!ucbvax!ucsfcgl!arnold From: arnold@ucsfcgl.UUCP (Ken Arnold%CGL) Newsgroups: net.lang.c Subject: Re: ANSI proposal for preprocessor strings Message-ID: <458@ucsfcgl.UUCP> Date: Mon, 4-Mar-85 16:37:20 EST Article-I.D.: ucsfcgl.458 Posted: Mon Mar 4 16:37:20 1985 Date-Received: Thu, 7-Mar-85 04:10:27 EST References: <8768@brl-tgr.ARPA> Reply-To: arnold@ucsfcgl.UUCP (PUT YOUR NAME HERE) Organization: UCSF Computer Graphics Lab Lines: 60 Summary: In article <8768@brl-tgr.ARPA> gwyn@Brl-Vld.ARPA (VLD/VMB) writes: >People who are using undocumented behavior of the specific (Reiser) >implementation of the C preprocessor are the only ones who will have >a problem with a fully tokenized CPP. Their code is ALREADY broken, >even though it appears to work on some systems. It should not be the >purpose of the C standards committee to legitimatize existing illegal >or nonportable use of C, but rather to define what usage IS portable. Let us say we have a preprocessor command # define FOO(d,e) printf("%d\n", e) Now, there are two ways this can be handled on current implementations (1) FOO(x,10) becomes printf("%x\n", 10) (2) FOO(x,10) becomes printf("%d\n", 10) There are two questions to be asked. (A) which way is more common, and (B) which way is more useful. I will concede that, since there are ways that (B) can be answered without using method (1), it is not relevant to this question, so I will just deal with (A). Most people who have objected to style (1) have stated that it is undocumented and/or illegal because it is not in K&R, and therefore should not be codified by the standards committee. But this is, quite simply, preposterous. Consider the following equivalent statement: "enum"s are not in K&R. They must, therefore, be an illegal extension, and should not be codified by the standards committee. Now, who out there subscribes to that? I know several implementations of C which don't have enums, just as gwyn knows a preprocessor that doesn't use style (1) (the Reiser style). But why should that make a difference? MOST implementations use enums. MOST implementations use them identically. enum's came from Bell Labs, and have become de facto standard, and therefore SHOULD be codified by the committee. Now, reread that statement thusly: MOST implementations use style (1). MOST implementations use it identically. Reiser's preprocessor came from Bell Labs, and has become de facto standard, and therefore SHOULD be codified by the committee. If this substitution makes no sense to you, please tell me why. It seems quite logical to me. I have yet to see a reason for excluding the Resier style which does not exclude enums. -- Ken Arnold ================================================================= Of COURSE we can implement your algorithm. We've got this Turing machine emulator...