On 2018-05-21 at 10:56, Paul Smith wrote:
> On Mon, 2018-05-21 at 08:20 +0200, Garreau, Alexandre wrote:
>> For instance, if there’s an occurence of $(several words) in the
>> makefile, and the variable “several words” isn’t defined (that’s not a
>> natural thing to do anyway), taking its firstword, and being equivalent
>> to $(call several,words) might improve readability, be simpler,
>> etc. then why not?
>
> For a long time it was perfectly legal to create variable names that
> contained whitespace; this would work:
>
>   some variable = foo
>
>   all: ; @echo $(some variable)
>
> gives you "foo".  A few releases ago I made it illegal to create
> variable names containing spaces so the above makefile no longer
> works.

I already did manage to create one before posting anyway:
none = #
spc = $(none) #
some$(spc)variable = foo
all:; echo '$(some variable)'
>  My intention at that time was to allow a shorthand for "call" such as
> you suggest, but I haven't made that change yet.

If then it has been planned this way, when might we see a such feature
arrive? :D

On 2018-05-21 at 07:46, Kyle Rose wrote:
> $(call x) rebinds the positional parameters. $x and $(x) do not. This
> distinction is used to break macro logic into smaller pieces in which $1 et
> al. still refer to the positional parameters from the top-level macro
> instead of being rebound to the empty string.

My suggestion was for only variable names containing a space, so $(x)
would keep legacy behavior, while $(x y) would work as any function
call.
_______________________________________________
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make

Reply via email to