error checking version of $(shell)

2020-05-18 Thread Britton Kerin
On Mon, May 18, 2020 at 11:24 AM Pete Dietl wrote: > > Speaking of > > > return value of a call to $(shell) is available in $(.SHELLSTATUS). > > I think it would be a nice addition to have some global setting where > any failed $(shell ) > command automatically fails Make. Agreed. I have a coupl

Re: Tail call elimination

2020-05-18 Thread Daniel Herring
On Mon, 18 May 2020, Paul Smith wrote: This is also an objection against $(eq) and $(not), which are hidden behind the EXPERIMENTAL compilation flag. It doesn't matter what the output is, IMO. Boolean expressions in GNU make are quite trivial: empty string is false, anything else is true. So

Re: string comparison operators (was: Re: Tail call elimination)

2020-05-18 Thread Paul Smith
On Mon, 2020-05-18 at 16:01 -0500, Pete Dietl wrote: > I concur that string handling and comparison should be considered in > a separate discussion. > > So let’s consider just integer comparison and arithmetic here? The usual method is someone makes a concrete proposal (say, something on the same

Re: string comparison operators (was: Re: Tail call elimination)

2020-05-18 Thread Pete Dietl
I concur that string handling and comparison should be considered in a separate discussion. So let’s consider just integer comparison and arithmetic here?

string comparison operators (was: Re: Tail call elimination)

2020-05-18 Thread Paul Smith
On Mon, 2020-05-18 at 20:04 +, Tim Murphy wrote: > Re comparing strings: we already have ifeq and what I have often > wanted is to have a function equivalent so I can use it in > expressions. As bad as ifeq may be from the point of view of locale > this need be no better to be an improvement ov

Re: Tail call elimination

2020-05-18 Thread Tim Murphy
Re comparing strings: we already have ifeq and what I have often wanted is to have a function equivalent so I can use it in expressions. As bad as ifeq may be from the point of view of locale this need be no better to be an improvement over the unpleasant hacks I've had to use to get the same effec

Re: Tail call elimination

2020-05-18 Thread Paul Smith
On Mon, 2020-05-18 at 21:05 +0200, Jouke Witteveen wrote: > Otherwise, POSIX prescribes an expr command, so with: > expr = $(shell expr '$1') > you can already do $(call expr,2 * 3 + 5). Please remember not every user of GNU make has access to a POSIX environment. I'm not suggesting we re-impleme

Re: Tail call elimination

2020-05-18 Thread Paul Smith
On Mon, 2020-05-18 at 21:05 +0200, Jouke Witteveen wrote: > On Mon, May 18, 2020 at 8:50 PM Paul Smith wrote: > > > > On Mon, 2020-05-11 at 16:32 -0500, Pete Dietl wrote: > > > I would like to know your thoughts about adding something like > > > $(expr > > > ) to evaluate integer expressions and

Re: Tail call elimination

2020-05-18 Thread Tim Murphy
$(shell) causes severe parse performance problems in large makefiles unless you use it extremely sparingly. [insert strong expression of frustration at make's deficiencies being treated as blessed] :-) Regards, Tim On Mon, 18 May 2020 at 19:18, Pete Dietl wrote: > > Each of these has an ob

Re: Tail call elimination

2020-05-18 Thread Pete Dietl
Also, I think an advantage of an $(expr) command is that we can have it return an empty string on false, whereas with shell we have to transform the output conditionally based on whether we are performing arithmetic or comparison...

Re: Tail call elimination

2020-05-18 Thread Pete Dietl
Speaking of > return value of a call to $(shell) is available in $(.SHELLSTATUS). I think it would be a nice addition to have some global setting where any failed $(shell ) command automatically fails Make.

Re: Tail call elimination

2020-05-18 Thread Pete Dietl
> Each of these has an obvious 'output', which is not the case for > something like a comparison operator. This is also an objection > against $(eq) and $(not), which are hidden behind the EXPERIMENTAL > compilation flag. I think the convection is that an empty string is false while a non-empty st

Re: Tail call elimination

2020-05-18 Thread Jouke Witteveen
On Mon, May 18, 2020 at 8:50 PM Paul Smith wrote: > > On Mon, 2020-05-11 at 16:32 -0500, Pete Dietl wrote: > > I would like to know your thoughts about adding something like $(expr > > ) to evaluate integer expressions and comparisons. > > I have no problem with some basic math facilities. We alr

Re: Tail call elimination

2020-05-18 Thread Pete Dietl
Yes

Re: Tail call elimination

2020-05-18 Thread Paul Smith
On Mon, 2020-05-11 at 16:32 -0500, Pete Dietl wrote: > I would like to know your thoughts about adding something like $(expr > ) to evaluate integer expressions and comparisons. I have no problem with some basic math facilities. We already have functions like $(word ...), $(words ...), and $(word

Re: Tail call elimination

2020-05-18 Thread Pete Dietl
Yeah I was thinking something like: VERSION := 1.3.0 OLD_VERSION := 1.2.0 EMPTY := SPACE := $(EMPTY) $(EMPTY) ver_is_less_than = $(strip \ $(let \ ( \ (major1 $(word 1,$(subst .,$(SPACE),$1))) \ (minor1 $(word 2, ...)) ... \ ) \ $(if $(expr

Re: Tail call elimination

2020-05-18 Thread Tim Murphy
I have often wanted to auto generate targets with progressive numbers to ensure uniqueness or count the number of times a particular macro is used and most especially to compare two numbers to see if they are numerically greater, less or equal. Example: generating rules from potentially very long

Re: Tail call elimination

2020-05-18 Thread Pete Dietl
> It should not be necessary for the use-cases of make I assert that arithmetic functionality does have use-cases in Make. Beyond building, I use Make for packaging my software and running tests. I often find that it would be useful to perform version comparisons and other simple packaging things.

Re: Mailing List Conventions

2020-05-18 Thread Paul Smith
On Mon, 2020-05-18 at 11:54 -0500, Pete Dietl wrote: > Any suggestions? > > On Wed, May 13, 2020 at 4:05 PM Pete Dietl > wrote: > > I am new to using mailing lists in general and I want to use it > > properly. Is there is a document somewhere that explains the > > conventions of using it. There

Re: Mailing List Conventions

2020-05-18 Thread Pete Dietl
Any suggestions? On Wed, May 13, 2020 at 4:05 PM Pete Dietl wrote: > I am new to using mailing lists in general and I want to use it properly. > Is there is a document somewhere that explains the conventions of using it. > Like how conversations are grouped together and what context I should > p