Re: Evaluating arithmetic expressions with macros (eval)

2023-10-16 Thread Eric Blake
On Thu, Oct 12, 2023 at 04:33:54PM +0100, Peter Hull wrote: > On Thu, 12 Oct 2023 at 15:56, Sébastien Hinderer > wrote: > > So according to that, I expected that autoconf would call m4 with the -P > > option and looked at my /usr/bin/autoconf script but it does not seem to > > contain any occurren

Re: Evaluating arithmetic expressions with macros (eval)

2023-10-12 Thread Peter Hull
On Thu, 12 Oct 2023 at 15:56, Sébastien Hinderer wrote: > So according to that, I expected that autoconf would call m4 with the -P > option and looked at my /usr/bin/autoconf script but it does not seem to > contain any occurrence of -P. But perhaps that appears in a sourced file > or so. You're r

Re: Evaluating arithmetic expressions with macros (eval)

2023-10-12 Thread Sébastien Hinderer
Hi, Peter Hull (2023/10/12 15:04 +0100): > On Thu, 12 Oct 2023 at 14:41, Sébastien Hinderer > wrote: > > Aht alone was useful. It made me realise that I was using eval, rather > > than m4_eval. I assume this is why it didn't work as expected. > > > > However, eval *is* documented in section 12.2

Re: Evaluating arithmetic expressions with macros (eval)

2023-10-12 Thread Peter Hull
On Thu, 12 Oct 2023 at 14:41, Sébastien Hinderer wrote: > Aht alone was useful. It made me realise that I was using eval, rather > than m4_eval. I assume this is why it didn't work as expected. > > However, eval *is* documented in section 12.2 Evaluating integer > expressions of the m4 info manual

Re: Evaluating arithmetic expressions with macros (eval)

2023-10-12 Thread Sébastien Hinderer
Dear all, Apologies for my so late response, when Nick's one came in so promptly and has been so useful. Nick Bowler (2023/10/04 16:29 -0400): > Hi, > > On 2023-10-04, Sébastien Hinderer wrote: > > I find myself stuck with something which I assume is trivial. I define: > > > > m4_define([X], [9]

Re: Evaluating arithmetic expressions with macros (eval)

2023-10-04 Thread Andreas Kähäri
On Wed, Oct 04, 2023 at 04:29:11PM -0400, Nick Bowler wrote: > Hi, > > On 2023-10-04, Sébastien Hinderer wrote: > > I find myself stuck with something which I assume is trivial. I define: > > > > m4_define([X], [9]) > > m4_define([Y], [3]) > > > > And I would like to define Z as being the arithme

Re: Evaluating arithmetic expressions with macros (eval)

2023-10-04 Thread Nick Bowler
Hi, On 2023-10-04, Sébastien Hinderer wrote: > I find myself stuck with something which I assume is trivial. I define: > > m4_define([X], [9]) > m4_define([Y], [3]) > > And I would like to define Z as being the arithmetic sum of X and Y and > can seem to get it. > > I tried several variations of