wrong and unclear conditional syntax documentation

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

wrong and unclear conditional syntax documentation

Britton Kerin
The manual says:

The syntax of the conditional-directive is the same whether the
conditional is simple or complex; after an else or not. There are four
different directives that test different conditions. Here is a table
of them:

ifeq (arg1, arg2)
ifeq 'arg1' 'arg2'
ifeq "arg1" "arg2"
ifeq "arg1" 'arg2'
ifeq 'arg1' "arg2"

There are five entries in the table, not four.  It's also unclear what
is different about the conditions being tested.  Different levels of
interpolation?

Britton

_______________________________________________
Help-make mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-make
Reply | Threaded
Open this post in threaded view
|

Re: wrong and unclear conditional syntax documentation

Paul Smith-20
On Fri, 2019-03-22 at 10:59 -0800, Britton Kerin wrote:
> It's also unclear what is different about the conditions being
> tested.  Different levels of interpolation?

There is no difference other than the delimiters used.  arg1 and arg2
are treated identically in all cases.

I don't really know why so many options are allowed, it seems
unnecessary to me.  We allow different ones so that you can write the
conditional without worrying about escaping characters.


_______________________________________________
Help-make mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-make
Reply | Threaded
Open this post in threaded view
|

Re: wrong and unclear conditional syntax documentation

Eli Zaretskii
In reply to this post by Britton Kerin
> From: Britton Kerin <[hidden email]>
> Date: Fri, 22 Mar 2019 10:59:30 -0800
>
> The manual says:
>
> The syntax of the conditional-directive is the same whether the
> conditional is simple or complex; after an else or not. There are four
> different directives that test different conditions. Here is a table
> of them:
>
> ifeq (arg1, arg2)
> ifeq 'arg1' 'arg2'
> ifeq "arg1" "arg2"
> ifeq "arg1" 'arg2'
> ifeq 'arg1' "arg2"
>
> There are five entries in the table, not four.  It's also unclear what
> is different about the conditions being tested.  Different levels of
> interpolation?

You stopped the citation too soon: the 4 forms are ifeq, ifneq, ifdef,
and ifndef.  What you quote above are 5 different flavors of the same
directive ifeq.

_______________________________________________
Help-make mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-make