autoconf
[Top][All Lists]
Advanced

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

On Cartesian Products and Simplicity


From: Bruce Korb
Subject: On Cartesian Products and Simplicity
Date: Wed, 13 Feb 2002 21:34:38 -0800

Akim wrote:
> I mean
>     {preprocess, compile, link, run}
>   x {function call, whole program, whole source}
    x {variations required for each supported language}

I think it's time to burn my few free moments on advocating
AutoGen again.  :-)

Simplicity of use is more than brevity of expression.
It takes into account breadth of choices.  Too many
choices --> hard to understand.  This is what I have
always thought and I think Akim is saying this.  Aliasing
AC_TRY_MUMBLE to AC_MUMBLE_IFELSE and making the latter
preferred increases choices and thus also obfuscation.

But there is another part, too.  I don't know the history
for sure, but my guess is that the TRY_MUMBLE -> MUMBLE_IFELSE
makes clearer the usage of the second and third arguments.
I argue that this is clearer still:

  conftest = { name = grumble;
    type   = compile; /* or "preproc" or "link" or "run" */
    body   = "body of main"; /* vs. "code = ..." or "prog = ..." */
    check  = "grumbling is effective";
    action = { yes; act-type = define; act-text = "1"; };
  };

Yes, this is more verbose than:

   AC_COMPILE_IFELSE([[ ... ]],
     AC_DEFINE([GRUMBLE],1,[define this if grumbling is effective]))

*BUT*

1.  Not by very much.

2.  I did not include the AC_MSG_CHECKING and AC_MSG_RESULT macros,
    either.  OTOH, we can add a "AC_MSG_*IFELSE" series to the
    "AC_*_IFELSE" series.  :-)  Let's double the cartesian result!

3.  new features (e.g., variations on how to construct the program
    text) increase user complexity incrementally, not as part of
    a cartesian product.

4.  Information passed to the "conftest" expansion does not have to
    be inserted at the right point in the argument list.  Naming
    the arguments makes things easier by giving obvious meaning.

5.  The underlying implementation can change without affecting the
    conftest specification.  After all, what is being supplied here
    is only the data required to perform a test.  It is completely
    separated from the implementation.  That means it is trivial
    to add functionality and not sweat backward compatibility.

Of course, one drawback is that the only mainstream distribution
with AutoGen is Debian.....

-- 

Bruce Korb <first initial + last name at gnu dot org>
AG URL: http://autogen.sourceforge.net



reply via email to

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