bug-make
[Top][All Lists]
Advanced

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

Re: Operators '=' ‘:=’ ‘::=’ in manual


From: Kyle Rose
Subject: Re: Operators '=' ‘:=’ ‘::=’ in manual
Date: Thu, 10 Dec 2020 14:01:25 -0500

On Thu, Dec 10, 2020 at 1:33 PM Paul Smith <psmith@gnu.org> wrote:
On Thu, 2020-12-10 at 18:19 +0000, DUDZIAK Krzysztof wrote:
> Operators ‘=’ ‘:=’ ‘::=’ seem to have two dimensions these control
> things expansion recursiveness (simple vs. recursive expansion)
> expansion time (immediate vs. deferred)

No, there is only one dimension really.

Either the content of the variable is expanded exactly once when it's
defined, or else it's not expanded when it's defined and is expanded
every time the variable is used.

All other aspects are just side-effects of this single difference.

I do agree that the terms "recursive variable" and "simple variable"
are misleading and/or not very informative.  These terms have been used
in the docs since it was created.

In the internal docs I've written for my company's build automation (based on GNU make), I explain recursive and simple variables via analogies to C preprocessor macros vs. C variables, which works well for most of those using the automation (which was designed for C and C++ builds). Delayed evaluation vs. immediate evaluation rvalues might work for others. Either way, I agree that the existing terminology is at best unhelpful for developers of other languages, and at worst misleading.


reply via email to

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