[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: New append operators (was: Re: New conditional assignment facility)
From: |
Paul Smith |
Subject: |
Re: New append operators (was: Re: New conditional assignment facility) |
Date: |
Sun, 28 Jan 2024 18:35:30 -0500 |
User-agent: |
Evolution 3.50.3 (by Flathub.org) |
On Sun, 2024-01-28 at 18:06 -0500, rsbecker@nexbridge.com wrote:
> > FOO +:= bar
> >
> > can be interpreted as working like this:
> >
> > FOO := $(FOO) bar
> >
> > which is what you and others are arguing for. Or it can be
> > interpreted as working
> > like this:
> >
> > __FOO := bar
> > FOO += $(__FOO)
> >
> > (where the value of __FOO is immutable). This is what I was
> > thinking.
>
> I do not think the above two are equivalent.
?? They're definitely NOT equivalent. That's the point. What I was
trying to say is that there are two DIFFERENT ways to interpret +:=.
You can either interpret "FOO +:= bar" to behave the same as
"FOO := $(FOO) bar" which is what you are suggesting.
Or you can interpret "FOO +:= bar" to be more-or-less equivalent to
writing:
__FOO := bar
FOO += $(__FOO)
If and only if __FOO was not modified after this. Of course there is
no way to guarantee that __FOO is not modified after this: there is no
such thing as an immutable variable in GNU Make.
So in that way this interpretation of "+:=" would be more powerful than
anything you can already do in GNU Make today and this would be a truly
new capability, not just a shorthand for "FOO := $(FOO) bar" (which you
can already easily write if that's what you want).
--
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
- Re: New conditional assignment facility, (continued)
- Re: New conditional assignment facility, Dmitry Goncharov, 2024/01/22
- New append operators (was: Re: New conditional assignment facility), Paul Smith, 2024/01/28
- Re: New conditional assignment facility, Paul Smith, 2024/01/27
- RE: New conditional assignm ent facility, rsbecker, 2024/01/27
- Re: New conditional assignm ent facility, Paul Smith, 2024/01/27
- RE: New conditional assignm ent facility, rsbecker, 2024/01/27
- New append operators (was: Re: New conditional assignment facility), Paul Smith, 2024/01/28
- RE: New append operators (was: Re: New conditional assignment facility), rsbecker, 2024/01/28
- Re: New append operators (was: Re: New conditional assignment facility),
Paul Smith <=
- Re: New conditional assignm ent facility, Edward Welbourne, 2024/01/29
- RE: New conditional assignm ent facility, rsbecker, 2024/01/29
- Re: New conditional assignment facility, Edward Welbourne, 2024/01/29
Re: New conditional assignment facility, Alejandro Colomar, 2024/01/11