bug-make
[Top][All Lists]
Advanced

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

Re: Conditional append operator (was: Re: New conditional assignment fac


From: Paul Smith
Subject: Re: Conditional append operator (was: Re: New conditional assignment facility)
Date: Sat, 02 Mar 2024 16:02:57 -0500
User-agent: Evolution 3.50.4 (by Flathub.org)

On Sun, 2024-02-18 at 22:23 +0100, Jouke Witteveen wrote:
> On Sun, Feb 4, 2024 at 12:05 AM Paul Smith <psmith@gnu.org> wrote:
> 
> 
> I feel these proposals are
> 1) not obvious in how they work, regardless of how they work, and
> 2) largely possible without new syntax.
> 
> The first of these is proven by the amount of communication so far.
> The second is true except for maybe leaking some helper variables.

I'm not sure I agree with both of these points but I'll think about
them.

One of the impetuses for providing these types of operators is to allow
them to be used on the command line.  Anything that requires breaking a
single operation up into multiple separate lines and using temporary
variables is quite annoying to manage on the command line.  As well,
"leaking some helper variables" is not necessarily a trivial thing in a
large/complex makefile especially when a random assignment "somewhere
else" far away in a different makefile (after inclusion) could break
the local behavior.

> For the original ?= these two points did not hold. When you
> understand what kind of problem it solves, it is fairly clear that it
> does so in a very reasonable way.
> 
> What about adding only ?:= and !:= and forgetting about appending?

The conditional operators have already been implemented and pushed:

https://git.savannah.gnu.org/cgit/make.git/commit/?id=1eff20f6f64d00f588c218e265f8d3a81a8fb00b

We are only right now discussing append operators.

And, I don't know what you mean by "!:=".  If you are simply trying to
have a way to get the behavior of := combined with $(shell ...) as an
operator, rather than writing it out, I'm not sure I see the point in
that.  It's not something I was considering.

-- 
Paul D. Smith <psmith@gnu.org>            Find some GNU Make tips at:
https://www.gnu.org                       http://make.mad-scientist.net
"Please remain calm...I may be mad, but I am a professional." --Mad
Scientist






reply via email to

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