autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 23-less-ac-subst.patch


From: Pavel Roskin
Subject: Re: 23-less-ac-subst.patch
Date: Tue, 23 Jan 2001 13:10:41 -0500 (EST)

> -# m4_expand_once(TEXT)
> -# --------------------
> -# If TEXT has never been expanded, expand it *here*.
> +# m4_expand_once(TEXT, [WITNESS = TEXT])
> +# --------------------------------------
> +# If TEXT has never been expanded, expand it *here*.  Use WITNESS as
> +# as a memory that TEXT has already been expanded.
>  m4_define([m4_expand_once],
> -[m4_provide_ifelse([$1],
> +[m4_provide_ifelse(m4_ifval([$2], [[$2]], [[$1]]),
>                     [],
> -                   [m4_provide([$1])[]$1])])
> +                   [m4_provide(m4_ifval([$2], [[$2]], [[$1]]))[]$1])])

My understanding of the above:

m4_expand_once(foo) will expand foo unless it was expanded before (i.e.
it's provided) and mark foo as provided.

m4_expand_once(foo, bar) will expand foo unless bar is provided and mark
bar as provided. I.e. "bar" is used instead of "foo" in the "provide
memory".

It's not a "witness", it's a "token", "handle" or maybe an "alias".
Anyway, let's not waste time discussing it.

By the way, consider factoring m4_ifval([$2], [[$2]], [[$1]]) which is
used twice. Maybe m4_default can help.

Regards,
Pavel Roskin




reply via email to

[Prev in Thread] Current Thread [Next in Thread]