What should an $(add) function look like?

2015-10-31 Thread Tim Murphy
Hi, I'm implementing some new GNU make functions as loadable modules and I just wondered if anyone had thoughts about how it would be best to implement some of them. The one I'm looking at now is meant to be a way to add integers. My major use would be to e.g. implement a counter so I'm mostly t

Re: What should an $(add) function look like?

2015-10-31 Thread Reinier Post
On Sat Oct 31 19:25:40 2015, tnmur...@gmail.com (Tim Murphy) wrote: > Hi, > > I'm implementing some new GNU make functions as loadable modules and I just > wondered if anyone had thoughts about how it would be best to implement > some of them. [...] > As I was implementing this, however, I thoug

What should an $(add) function look like?

2015-10-31 Thread thutt
Tim Murphy writes: > Hi, > > I'm implementing some new GNU make functions as loadable modules and I just > wondered if anyone had thoughts about how it would be best to implement > some of them. > > The one I'm looking at now is meant to be a way to add integers. > > My major use would

Re: What should an $(add) function look like

2015-10-31 Thread Tim Murphy
On 31 Oct 2015 8:10 p.m., "Reinier Post" wrote: > > On Sat Oct 31 19:25:40 2015, tnmur...@gmail.com (Tim Murphy) wrote: > > $(add 1 2 3 -1 1) > > I like this, to me it seems to fit more naturally with existing > functions. As the name I would use 'sum': 'add' suggests only > twp arguments and s

Re: What should an $(add) function look like

2015-10-31 Thread Tim Murphy
On 31 Oct 2015 9:02 p.m., wrote: > > Tim Murphy writes: > > Hi, > > > > I'm implementing some new GNU make functions ... > Perhaps your question is generalized about functions, but in case you > are planning to implementat arithmetic, please know that the Gnu Make > Standard Library (so name

Re: Make loadable extension library

2015-10-31 Thread Paul Smith
On Thu, 2015-10-29 at 19:02 +, Tim Murphy wrote: > 1) The return value must be allocated by the function, after which > make copies it into a buffer and deallocates it. [...] It seems as if > it would be much better to expose GNU make's variable buffer interface > and cut out the extra memory a