Carrying around excess baggage.

der Mouse mouse at mcgill-vision.UUCP
Sat Sep 16 13:21:34 AEST 1989


In article <1989Sep5.224525.634 at utzoo.uucp>, henry at utzoo.uucp (Henry Spencer) writes:
> In article <1418 at atanasoff.cs.iastate.edu> hascall at atanasoff.cs.iastate.edu (John Hascall) writes:
>> All the (proposed) ANSI C standard seems to have done is made every
>> quirky little implementation "official"...
> You obviously weren't around for the Reiserism Wars, when a good many
> people rose in outrage because X3J11 disallowed some undocumented,
> ugly, poorly-thought-out "features" of the Reiser C preprocessor
> (used in most Unix C compilers).

...and replaced them with ugly, poorly-thought-out features.  At least
the new ones are documented.  I suppose this is progress.

Why do I say ugly and poorly thought out?  It's inextensible and
confusing, when it would have been so *easy* to do it in a nice
extensible, unconfusing, and no more incompatible[$] manner!

#define paste(foo,bar) foo ## bar /* what the dpANS says[%] */
#define paste(foo,bar) foo #paste bar /* what I would recommend */

#define stringize(foo) # foo /* what the dpANS says[%] */
#define stringize(foo) #string foo /* what I would recommend */

[$] Unless the compiler I mention in the next paragraph exists.
[%] I may have the dpANS # and ## interchanged.  See next paragraph.

Clean.  Easy to keep straight which is which.  Easy to extend when you
want to do something else strange with macro arguments.  Was something
like this proposed?  (Surely.)  Why was it turned down?  Was there -
gack! - some compiler that already used # and ## (aka "prior art")?

Ah well, at least it's better than what we had.  Now everyone will use
the *same* ugly features.

					der Mouse

			old: mcgill-vision!mouse
			new: mouse at larry.mcrcim.mcgill.edu



More information about the Comp.lang.c mailing list