Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!apple!usc!samsung!olivea!orc!inews!hopi!bhoughto From: bhoughto@hopi.intel.com (Blair P. Houghton) Newsgroups: comp.lang.c Subject: Re: ANSI C and comment preprocessing Message-ID: <1654@inews.intel.com> Date: 8 Jan 91 06:48:04 GMT References: <11228@cae780.csi.com> Sender: news@inews.intel.com Organization: Intel Corp, Chandler, AZ Lines: 27 In article <11228@cae780.csi.com> donald@cae780.csi.com (Donald Maffly) writes: > "[...] comments are replaced by a single space;" > >Can anyone help me answer this koan???? It's not a koan, it's a feature. ANSI standardized existing practice; i.e., there were relatively few compilers that replaced comments with no whitespace (i.e., most considered comments to be whitespace). The philosophy is that it is legal to put a comment only where it would be legal to put whitespace, and it's more important to adhere to this philosophy than to enable an obfuscatory feature, and whitespace is not legal within identifiers, therefore if there's a comment there it's considered whitespace. Did it break existing code? Sure it did, but such code was unportable to all but a few platforms, anyway. As compensation, however, ANSI included explicit token-pasting. --Blair "I asked, 'Master, why should I code for(;;) when what I mean is while(1)?' and the master said, 'the pot of tea comes with hot water at no additional charge,' and I was enlightened."