bug-make
[Top][All Lists]
Advanced

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

Re: Idea: Allow $(name ...) as an abbrevation of $(call name ....)


From: Tim Murphy
Subject: Re: Idea: Allow $(name ...) as an abbrevation of $(call name ....)
Date: Mon, 10 Jun 2019 22:46:23 +0100

If you can't make first-class functions that are the equal of $(filter) or $(subst) or whatever, or indeed replace them, then it seems like a bit of a fudge for the sake of 4 characters. 

I think one could end up having huge discussions about this to a pretty limited benefit and miss spending the time on some of your other proposals which get around really significant problems.

Regards,

Tim

On Mon, 10 Jun 2019 at 04:46, David A. Wheeler <address@hidden> wrote:
On Mon, 10 Jun 2019 11:56:04 +0900, Masahiro Yamada <address@hidden> 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
address@hidden
https://lists.gnu.org/mailman/listinfo/bug-make

reply via email to

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