bug-make
[Top][All Lists]
Advanced

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

[RFC] Scoped variables, supercharged


From: thutt
Subject: [RFC] Scoped variables, supercharged
Date: Thu, 26 Dec 2019 09:13:18 -0800

Jouke Witteveen writes:
 > Hi,
 >
 > I would like make to have scoped variables. Here, I will propose an
 > implementation of them. This implementation is currently without tests and
 > documentation. Hopefully, the proposal is acceptable and I can add the
 > tests and documentation.
 >
 > Consider a situation in which we have macros F and G, and some variable X,
 > and our makefile includes:
 >
 >   $(call F,$(call G,$(X)),$(call G,$(X)))

 Your proposal has the potential to create variables that would have
 scope local to a single invocation of a user-defined function, but it
 wouldn't provide scoping to Make-proper.  For that reason alone, I
 would suggest narrowing down the naming of the feature.  Perhaps
 something like:

   Function local variables

 Have you considered how this might affect target- and
 pattern-specific variables?

 What would the affect be of a local variable overriding the name of a
 global variable?

 Finally, have you taken a look at the so-called Gnu Make Standard
 Library (GMSL)?  The implementation of dictionaries in that piece of
 software reduces the need to introduce changes to Gnu Make to support
 variable scoping -- but I accept that might be a controversial view.





reply via email to

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