🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #2620

Re: The Preprocessor and tokens

#2620
From: Karl Heuer
Date: Thu, 28 Mar 1991 02:29
39 lines
2409 bytes
In article <15606@smoke.brl.mil> gwyn@smoke.brl.mil (Doug Gwyn) writes:
>Many alternative proposals were offered, including several from members of
>the public during the public review process, but ALL of them were
>technically flawed.

It may be that D. Hugh Redelmeier's proposal (X3J11/88-083, letter P24,
item 33/36) had some technical flaw, but if so, it wasn't the flaw that the
Committee asserted in their response.  (Hugh's proposal did not misparse
"1e4+6", nor any other valid construct as far as I can see.)

In case anyone's interested, here are the relevant patterns in egrep form.
X3J11:	[.]?[0-9]([0-9a-zA-Z_.]|[eE][-+])*
Karl:	[.]?[0-9][0-9.]*([eE][-+])?[0-9a-zA-Z_.]*
Hugh:	[.]?[0-9]([0-9.]|[eE][-+])*[0-9a-zA-Z_.]*

There's not much point in continuing to argue this, since the current
Standard is frozen.  On the bright side, we have:

[0] At least it's not a Quiet Change; any code that's broken will cause a
diagnostic rather than getting the wrong answer.

[1] A helpful compiler can always issue the diagnostic, and then guess what
you meant and do the right thing anyway.

[2] Those of us who normally put whitespace around binary operators won't be
hit by it anyway.

[3] If the C-2001 Committee decides it was a bad idea, they can still fix it,
since no working code can depend on this glitch.

[4] If, at the C-2001 Standardization Committee meeting, somebody puts LSD
into the drinking water and they decide to allow hexadecimal floating-point
constants, it'll be relatively easy to add.

[5] The experience may be helpful in designing a new language from scratch.
Using "1.0E2" and "1.0E_2" is perhaps a better idea than allowing "+" and "-"
to appear in the middle of a token.

Karl W. Z. Heuer (karl@ima.isc.com or uunet!ima!karl), The Walking Lint
Technical Details
Message-ID: <1991Mar28.022926.26118@ima.isc.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!sdd.hp.com!spool.mu.edu!snorkelwacker.mit.edu!hsdndev!spdcc!dirtydog!karl
References: <3137@wyse.wyse.com> <1991Mar27.033525.21697@tkou02.enet.dec.com> <15606@smoke.brl.mil>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!sdd.hp.com!spool.mu.edu!snorkelwacker.mit.edu!hsdndev!spdcc!dirtydog!karl
From: karl@ima.isc.com (Karl Heuer)
Newsgroups: comp.std.c
Subject: Re: The Preprocessor and tokens
Message-ID: <1991Mar28.022926.26118@ima.isc.com>
Date: 28 Mar 91 02:29:26 GMT
References: <3137@wyse.wyse.com> <1991Mar27.033525.21697@tkou02.enet.dec.com> <15606@smoke.brl.mil>
Sender: usenet@ima.isc.com
Reply-To: karl@ima.isc.com (Karl Heuer)
Organization: Interactive Systems, Cambridge, MA 02138-5302
Lines: 39