[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
Re: Why call is not calling like native primitives? even when var is otherwise undef?
Mon, 21 May 2018 07:46:46 -0400
$(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.
On Mon, May 21, 2018, 4:11 AM Garreau, Alexandre <address@hidden
Why not, like in shell, when some function/variable is undefined, call
an internal one when defined? What’s the historic reason of this?
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?
And then I asked myself, if some functions weren’t deemed useful enough
to get integrated as native primitives implemented in C, why do we still
need to use the $(call fun,args) syntax when it could be done like shell
and decide that any multi-word undefined reference could take its
firstword and use it as call does? like if in “$(fun args)”, the
variable “fun args” being if not undefinable, at least inaccessible, if
the "fun" variable exists, make it equivalent to “$(call fun,args)”?
Thank you for your time, hoping my message isn’t too much confuse or
Bug-make mailing list