[comp.std.c] Macro names imbedded in pp-numbers

datanguay@watmath.waterloo.edu (David Adrien Tanguay) (11/22/89)

In article <TOM.89Nov20072452@hcx2.ssd.harris.com> (Tom Horsley) writes:
 >>As I recall the committee sentiment, it wasn't felt that this slightly
 >>over-generous glomming onto source characters for pp-numbers posed a
 >>serious practical problem, and it did drastically simplify that part
 >>of the preprocessor.  The trade-off seemed worthwhile.
 >
 >I am sorry, I can't watch this discussion passively anymore. This is simply
 >wrong. I was one of the first to complain to the committee about this bug.
 >The reason I noticed it was that I was writing a tokenizing pre-processor as
 >the standard was under development. In my implementation, I did not find
 >*ANY* simplification that pp-numbers provided.

I had to add a little code to my cpp, too. However, Doug meant that
it simplified the standard's specification, not necessarily any
implementation of cpp.

As you mention further on in your article, it may have been possible to
come up with a clean specification, but it would have required a lot of work
to verify that the new specification didn't fall apart in some other area.
I guess the committee decided that this one minor wart wasn't worth the
trouble.

David Tanguay

jss@jra.ardent.com (11/28/89)

I have decided to add my 2 cents to this discussion because
I am the person who originally formulated the idea of pp-number 
in a comment during the _first_ public review.

I was motivated to do so by two factors.  

    One (which has already been alluded to) was the need for a 
    precise definition of token.  An associate was working on a 
    preprocessor and the definition in the draft (based on the
    idea of longest legal prefix) were ambiguous.  We attempted
    to clean it up, but found ourselves getting into a quagmire
    of complexity.  The pp-number approach seemed much simpler. 
    
    The second (which I have not seen mentioned) was the need to 
    allow for extending the possible forms of numbers into the future.
    E.g. 0b1001, 1LL, 4K.  With the current specification all these 
    might be taken as numbers (binary, long long, scaled by 1024) by 
    a conforming compiler or in some future version of C. 

Ease of implementation was not a consideration at all.  

Jerry Schwarz