[Top][All Lists]

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

Re: [PATCH 3/3] Introduce $(compare ...) for numerical comparison

From: Jouke Witteveen
Subject: Re: [PATCH 3/3] Introduce $(compare ...) for numerical comparison
Date: Tue, 16 Nov 2021 11:29:55 +0100

On Tue, Nov 16, 2021 at 10:28 AM Edward Welbourne
<edward.welbourne@qt.io> wrote:
> On Sun, Nov 14, 2021 at 8:42 PM Paul Smith <psmith@gnu.org> wrote:
> > It's even possible to allow $(compare <lhs>,<rhs>) with no other
> > arguments and say that if they are equal then it expands to the value,
> > else it expands to the empty string, to give a very short-circuited
> > equality statement.
> I should point out one bug in that: if the two parameters are equal
> *but empty* you're going to mistake that for them being different.

Empty strings will not be accepted as <lhs> or <rhs>, since those
arguments are parsed as numbers. A case like
  $(compare +0,-0)
would expand to "0" (without quotes), which is how the value would be
formatted by the standard C routines.
I don't think there is a bug here.

- Jouke

reply via email to

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