Open xrchz opened 5 years ago
I don't think context can be inferred because these functions can occur on the RHSes of arbitrary variable definitions which may then be used in different places.
And I guess the expansion happens at variable definition time rather than use?
Hmm. Good point. I think that in theory make
is supposed to expand at time of use, but I'm not so sure Holmake does this.
Make has two kinds of variable that differ in exactly this respect. https://www.gnu.org/software/make/manual/html_node/Flavors.html#Flavors
Indeed.
There are two
Holmakefile
functions that, from a user's perspective, serve the same purpose: namely, protect strings that contain spaces or other unusual characters from being split into multiple items or otherwise mistreated.protect
protects a string from the OS shell anddprot
protects a string fromHolmake
's tokenisation.I suggest these functions be accessible under a unified name (
protect
) and the correct semantics inferred from context (whether the string appears as a shell command vs not). This should also meanprotect
covers usage in variable definitions (e.g.,INCLUDES
).