autoconf-patches
[Top][All Lists]
Advanced

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

Re: about the ! builtin


From: Paul Eggert
Subject: Re: about the ! builtin
Date: Wed, 26 May 2004 10:57:25 -0700
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

Bruno Haible <address@hidden> writes:

> Can you please mention that the general replacement rule is that
>
>   ! statement;
>
> becomes
>
>   { if statement; then false; else true; fi; }

OK, but the "false" has to be "(exit 1)" to make it a safe replacement
in general; also, the braces aren't necessary.  I installed this:

2004-05-26  Paul Eggert  <address@hidden>

        * doc/autoconf.texi (Limitations of Builtins): Mention that ! COMMAND
        can be rewritten using if-then-else.  Suggested by Bruno Haible.

--- autoconf.texi.~1.818.~      2004-05-25 11:11:41 -0700
+++ autoconf.texi       2004-05-26 10:52:27 -0700
@@ -10382,6 +10382,11 @@ such code, e.g.:
 cmp file1 file2 >/dev/null 2>&1 || echo files differ or trouble
 @end example
 
+More generally, one can always rewrite @samp{! @var{command}} as:
+
address@hidden
+if @var{command}; then (exit 1); else :; fi
address@hidden example
 
 @item @command{break}
 @c ------------------




reply via email to

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