Hi,

On 12/2/21 7:11 AM, Paolo Amoroso wrote:
Is it possible to create an m4 macro expanding to the next integer of a global counter each time it's called?

I don't know.

I /feel/ like it should be possible.

But my brain is definitely not in m4 mode this morning.

In other words, assuming the counter has an initial value (e.g. 0), these calls to such a nextcount macro:

     First call: nextcount
     Second call: nextcount
     Third call: nextcount

should generate the following output:

     First call: 1
     Second call: 2
     Third call: 3

I'm stumped as I'm not sure updating the global state of a counter is even possible with m4. Is there any way?

It sounds like you have some code that you're working on. Can you share a (sanitized version of) it so that we know how you're doing things and how complex / level of nesting the environment you're working on is?



--
Grant. . . .
unix || die

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to