Macro sustitution inside quotes

Boyd Roberts boyd at necisa.ho.necisa.oz
Tue Apr 10 11:43:04 AEST 1990


In article <12534 at smoke.BRL.MIL> gwyn at brl.arpa (Doug Gwyn) writes:
>
>Twisted?  It is about as straightforward as anything else about C.  I
>find string catenation very handy in cases where the source code is
>highly indented or the string is particularly long.

If I need a long string, I'll use a long string.

String concatenation and the # operator just isn't keeping with the
style of the language.  The # operators are particularily revolting:

    #define string(s)	# s

It is not obvious or intuitive what kind of expansion occurs.  Whereas:

    #define string(s)	"s"

evaluates in the way you would expect.

Apart from that, # operators break things.  Why weren't the Reiser
conventions just formalised?  Oh no, that would be too easy.

There is no basis in the language for string concatenation.  It is
at odds with the lexical and syntactic structure of the language.

With operators:

    a _op_ b

Not:

    a b

for some defined operation.

Function calls:

    f(a, b)

Not:

    f(a b)

Initialisation:

    int	a[2]	= { 1, 2 };

Not:

    int	a[2]	= { 1 2 };

Etc etc.

The preprocessor and language weren't broken.  But they got `fixed' anyway.


Boyd Roberts			boyd at necisa.ho.necisa.oz.au

``When the going gets wierd, the weird turn pro...''



More information about the Comp.std.c mailing list