define(bump,`define(`$1',incr($1))')dnl
define(counter,0)dnl
counter
bump(`counter')counter
bump(`counter')counter
On Thu, Dec 2, 2021 at 11:49 AM Grant Taylor via Discussion list for
the GNU M4 wrote:
>
> Hi,
>
> On 12/2/21 7:11 AM, Paolo Amoroso wrote:
> > Is it possible to create an m4 macro e
I think of m4 as a switchyard for data streams. There are various internal
flows, e.g. to or from arguments, and to or from macro definitions.
divert() affects only the (normally) external output flow, capturing it
instead somewhat like a macro definition--but eventually simply copied to
the extern
It is annoying that various builtin macros don't argument lists like
ordinary macros do.
dnl complains if given an argument list--even an empty one. info m4 has a
long discussion about how dnl treats arguments, even though the treatment
is exactly the same as for non-builtin macros. When the argum
hide the ERROR diagnostics mentioned
above. But I don't think it's necessary to support the portability of
fatal errors.
Doug
On Sat, Dec 7, 2024 at 11:02 PM Eric Blake wrote:
>
> On Fri, Dec 06, 2024 at 05:33:09PM -0500, Douglas McIlroy wrote:
> > Arguments are c
Arguments are collected if a macro name is "immediately" followed by a
left parenthesis. Experiment shows that arguments are not collected
when a macro name occurs at the end of a file (without a following
newline) and the next input file begins with a left parenthesis. I
believe this behavior is i
I'm delighted to receive the progress report, and especially the
mention of tail recursion. Am I right in guessing that all tail calls
will benefit, so that n levels of tail recursion will use O(1) stack
space rather than O(n)?
Doug McIlroy
On Thu, Apr 3, 2025 at 3:37 PM Eric Blake wrote:
>
> On
This program
define(`A', x define('A',y)A z)
A
produces this answer
y
It appears that the inner definition stamps on the
outer definition in progress. I imagine that each
allocates and fills a string that it assigns as the
stored definition for A, The inner one, being
assigned later,
Eric Blake wrote, "Writing a truly generic
lambda() that can define an anonymous m4 macro is much tougher,
because of the inability to easily generate '$1' and friends into the
macro body without having it be prematurely expanded. In the
literature, I have seen reference to the "M5" language, wher
A new version of www.cs.dartmouth.edu/~doug/barem4.m4 enables
functional programming within m4. This thoroughly annotated
implementation of barem4 uses no builtin macros other than `define',
thereby demonstrating that the heart of m4 is Turing complete. In
particular, it provides conditional execut
echo foo | m4 -Dfoo=\`bar\' -Dbar=baz
On Mon, Oct 12, 2020 at 8:24 AM Eric Blake wrote:
> On 10/12/20 5:27 AM, Wolf wrote:
> > Hello,
> >
> > Not subscribed to the list, so please CC.
>
> That's standard practice anyway ;)
>
> >
> > I have m4 template that contains macro, that I do not know the
10 matches
Mail list logo