bug-gnulib
[Top][All Lists]
Advanced

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

Re: m4: use AC_SUBST with two arguments when applicable


From: Akim Demaille
Subject: Re: m4: use AC_SUBST with two arguments when applicable
Date: Sun, 10 May 2020 12:12:40 +0200

Hi Bruno!

> Le 9 mai 2020 à 22:14, Bruno Haible <address@hidden> a écrit :
> 
> Hi Akim,
> 
> (A) > I'm looking for means to avoid repetitions, and boilerplate.
> 
> It needs to be balanced against the other characteristics of maintainability.
> Two important aspects are:
>  (B) Making the code easy to understand.
>  (C) Making it easy to find all definitions and all references of an 
> identifier.

[...]

> Until the day I had to debug a complex invocation of a complex, hand-crafted,
> scarcely documented macro. I even had an IDE that showed me the result of the
> macro-expansion when I modified the input; nevertheless, since then, I tend
> to value (B) and (C) as more important than (A).

I fully subscribe to what you are reporting here.  I have suffered from
equivalent symptoms in other languages, and also caused that suffering to
others myself.

Yet in the present case, I do not see it as clearcut as you do.  I
wholeheartedly agree with the 'git grep' argument.  That's why I had
last proposed

gl_SUBSTS([
  GNULIB_ISWBLANK=0
  GNULIB_ISWDIGIT=0
  GNULIB_ISWXDIGIT=0
  GNULIB_WCTYPE=0
  GNULIB_ISWCTYPE=0
  GNULIB_WCTRANS=0
  GNULIB_TOWCTRANS=0
])

which does not, to my eyes, suffer from all the defects you see.  I view
AC_SUBST as meta data, not as actual substitutions, and I don't see a problem
with factoring such meta data.  I do like the clarity and regularity it
provides, including the case of very long identifier which are currently
treated on two lines, whereas most of them are one a single one.

Thanks for having taken the time to explain your point of view in details!

Cheers!

        Akim


reply via email to

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