[Gllug] Website developement

Nix nix at esperi.demon.co.uk
Sun Jul 15 22:42:46 UTC 2001


On 15 Jul 2001, Stig Brautaset stipulated:
> Nix <nix at esperi.demon.co.uk> writes:
>> You do this, and you haven't realised that this is saying something?
>> (Like `cpp is the wrong tool'?)
> 
> Try "cpp is not the best tool", and I'll agree. But it works for
> me. For now at least, and when it doesn't, I'll find something
> else. It is that simple.

I'm really trying to convince other people without a mass of webpages to
convert that using something else is probably better :)

(That's other useful thing you can do in M4; loops; it's tricky, but
it's been done for you. autoconf-2.50/m4sugar.m4 contains code to do
if/then/else, case statements, foreach loops, and so forth. You can't
*quite* use it as is; you'll need to grab the bits you want and do an
s/m4_//g over them.

But you *cannot* do generalized looping in cpp. You can get close, with
obfuscated horrors, but you can't quite get there.)

>> (More problems: digraphs, trigraphs, /* sequences and the di- and
>> trigraph equivalents to them, and backslashes will also fubar your
>> preprocessing assumption of plain text. M4 has none of these problems.)
> 
> Digraphs and trigraphs I believe you have to switch on explicitly, and

Yes, *with GCC*. With other preprocessors (that used by the decidedly
nice compiler on Tru64, for instance), this is not necessary. IMHO, it
should not be necessary with GCC either, but then I'm a standards
pedant.

(If you want the preprocessor to act like you seem to want it to act,
`cpp -traditional' is what you want.)

> anyway I do not use such combinations of letters.

I find ??' to be depressingly common; a sentence like

'what the hell??' will trip over it, and then people whine because the
system's saying that the string is unterminated. (Yes, even in a comment
--- although, of course, in a comment you don't care what it looks like
after expansion. You do care, though, about ??/ inside comments --- yes,
really.)

>                                                   Where do you use a
> backslash in normal text? Rarely, I'm sure,

Er, *grasps at straws* DOS pathnames?

<P>This line ends the paragraph, thanks to C:\FOO\BAR\

<P>oops.

(Of course, this just goes to show that you should have used </P> ;) )

>> FWIW, the set of potentially #defined symbols is not bounded, so in
>> order to work safely you must #undef every single word you intend to
>> write before you use it. *All* of them. If you don't do that, you'll
>> have a webpage preparation system that could be broken by moving it from
>> one system to another, or by upgrading the compiler.
> 
> Again, as stated in another post, have a look at my webpage and look
> at the complexity of it. 

I'm really trying to convince people here who might be responsible for
larger sites to use a mechanism other than cpp; it works, but it's more
pain than it's worth.

(Everyone should use a mix of /bin/sh, M4, Emacs Lisp, and Guile Scheme
like me. Er, no, perhaps not.)

>> You never need to use # for anything, either?
> 
> Not to date, but # would suffice if I did. 

This lovely line has been commented on, but I'd really like to snarf it
for a sig (anonymously, if you wish).

>> (No, you don't; GCC-2.95.4 isn't released yet. You probably have
>> something from the head of the GCC-2.95 branch in CVS.)
> 
> That's correct, it is a debian pre-release.

I thought it'd be Debian; they're the only major distro that I know make
a habit of this kind of thing (and normally they pick their moment to
snatch from the branch head well, too).

>> >                 and that works like a charm.
>> 
>> Querulous and fragile, with unknown function and who knows what snakes
>> lurking under the surface?

(Er, this was a description of magical charms, as depicted in most works
of fantasy... reliable they are generally not.)

>> If you think that the preprocessor's behaviour on plain text is a good
>> guide to its behaviour on C code, you are mistaken (because of the
>> tokenization).
> 
> Ok, you have prooved your point, M$ is the way to go; I am stupid and

Er, no. I'm not trying to convince you, but random observers. Maybe I'm
overdoing it (as usual). Experience with people going *way* too far ---
i.e., experience with the hell that is imake --- has seared my wrinkly
little soul.

-- 
`I'm not sure whether libtool is an existence proof that you _can_
 write a shell script that handles its arguments correctly, or a
 demonstration that you may try but you are doomed to failure.'
                                                       -- Zack Weinberg


-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list