autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: changequote


From: Mirar
Subject: Re: changequote
Date: 22 Dec 2000 16:14:24 +0100

> Mirar> Since m4 environment will not let you change the environment
> Mirar> (changequote) if you need to use quoting in macros, I think
> Mirar> this was a good idea. I think major the design miss was to use
> Mirar> m4 in the first place, since it doesn't work well in
> Mirar> API-to-black-box environments.
> 
> This is a very common bizarre viewpoint.  I see no relationship with
> M4 at all.  You need some escaping mechanism, you just nice a
> nanosecond thinking to know that.

Yes, and M4's approach doesn't work well if you don't set up your
macro library yourself. What I call black box is when someone else
sets up and maintains something that you only get an API to, something
you only can interface and not assume anything about. Since m4's
quoting system doesn't allow that - you need to demand other things.

In my opinion, m4 only works for files like .Xdefault and other simple
non-presuming text expansion.

> NOw, would you ever criticize C and most languages because you have to
> escape double quotes inside strings?

No, since both CPP macros and C functions work well in a black box
environment - you don't need to know how the function are represented
to add your own quoting.

And I *can* use every possible character inside a string; both the
'\"' and '\042' mechanisms make sure of that. In a raw m4 environment,
I don't have that possibility without changequote.

autoconf *could* have been written using CPP instead of m4, but I'm
not so sure if that's a good alternative since CPP doesn't like to
newlines that much, and newlines is an integrated part of sh.

Personally, I would probably have used neither - writing a new parser
in C doing a suitable macro expansion for sh would have been my option.

Now, I didn't come up with the great idea of autoconf and a huge macro
library, on the other hand. :)

> Mirar> Yes, but what you will lose is two things: autoconf is no
> Mirar> longer m4, and it's no longer backwards compatible with older
> Mirar> autoconfs. May I suggest that the verison is bumped to autoconf
> Mirar> 3 to avoid this confusion in the future?
> 
> Yes you may, but it will be 2.50.  The fact that broken configure.in
> no longer work is no surprise, and it could have happened in 2.15.

Yes, that version should have been named 3.x too, imho.

It's interesting that you call it broken, though. <= 2.13 it was
assumed that you had a true m4 environment; most macros didn't quote,
so you could use changequote, and you could make use of m4 define.

Is that - define - going to be dropped too, btw?

/Mirar




reply via email to

[Prev in Thread] Current Thread [Next in Thread]