bug-make
[Top][All Lists]
Advanced

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

Re: Why call is not calling like native primitives? even when var is oth


From: Garreau\, Alexandre
Subject: Re: Why call is not calling like native primitives? even when var is otherwise undef?
Date: Mon, 21 May 2018 18:06:44 +0200
User-agent: Gnus (5.13), GNU Emacs 25.1.1 (x86_64-pc-linux-gnu)

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.

reply via email to

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