[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Operators '=' ‘:=’ ‘::=’ in manual
From: |
DUDZIAK Krzysztof |
Subject: |
RE: Operators '=' ‘:=’ ‘::=’ in manual |
Date: |
Tue, 15 Dec 2020 10:17:50 +0000 |
Variables defined using '=' are, according to manual' expanded recursively
and they do allow self-referencing. However if one uses latter one, they
land onto infinite recursion (as you mentioned). These are two separate
questions
* to be allowed
* to result in some special effect
> -----Original Message-----
> From: Paul Smith [mailto:psmith@gnu.org]
> Sent: Freitag, 11. Dezember 2020 19:04
> To: DUDZIAK Krzysztof <krzysztof.dudziak@thalesgroup.com>; bug-
> make@gnu.org
> Subject: Re: Operators '=' ‘:=’ ‘::=’ in manual
>
> On Thu, 2020-12-10 at 18:40 +0000, DUDZIAK Krzysztof wrote:
> > I don't actually dare to use terms "recursive variable" and "simple
> > variable" as myself didn't find such in manual. Terms which I found
> > read variable expanded recursively variable expanded simply
>
> I still believe these are poor terms.
>
> All variables are "recursively expanded" when they are expanded: that is, all
> references to all variables inside the value are expanded, and all references
> to all variables inside any of those values are expanded, etc. recursively.
> Expansion happens identically in all cases.
>
> The difference is not in HOW they are expanded, but rather WHEN they are
> expanded.
>
> The term probably was used to refer to one specific difference which is that
> recursively expanded variables don't allow you to have self- referencing; you
> can't do this:
>
> FOO = bar $(FOO)
>
> because you'd get "infinite recursion". That is certainly one legitimate
> difference but I don't think it deserves to drive the naming . But as I say,
> these terms have been in the docs since forever so changing them would
> need to be done carefully.