On Mon, 10 Jun 2019 11:56:04 +0900, Masahiro Yamada <masahi...@kernel.org> 
wrote:
> It is a design.

Sure, but we can add to it.

> In summary, there is slight difference between
> a variable and a user-defined function.
> Omitting 'call' makes obscure the difference between them.

I don't think it obscures the difference at all.
The presence of parameters makes the difference quite obvious.

Let's use the examples from:
https://www.gnu.org/software/make/manual/html_node/Call-Function.html

# Current:
foo = $(call reverse,a,b)
# Proposed alternative:
foo = $(reverse a,b)

# Current:
LS := $(call pathsearch,ls)
# Proposed alternative:
LS := $(pathsearch ls)


# Current:
o = $(call map,origin,o map MAKE)
# Proposed alternative:
o = $(map origin,o map MAKE)


There is *one* case I can agree would be obscure.
That would be a space with NO parameters. E.g., $(hello ).
That's more likely to be an error than a function call.
So perhaps the short form should require something other than a ")"
right after the name's whitespace; if you want to call a function
with no parameters (why?) you'd be required to use $(call NAME).
I'd be happy with that limitation on the syntactic sugar.

--- David A. Wheeler
_______________________________________________
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make

Reply via email to