[Top][All Lists]

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

Re: M4 syntax $11 vs. ${11}

From: Gary V. Vaughan
Subject: Re: M4 syntax $11 vs. ${11}
Date: Tue, 20 Feb 2007 00:55:20 -0700

Apologies for joining the conversation so late:

On 30 Jan 2007, at 07:23, Eric Blake wrote:
How about if M4 uses a slightly-different syntax, so that the two uses
are never confused?  That way, the conversion problem won't ever have
to be addressed, and Autoconf won't have to disable the extension
during a transition period.

So, for example, suppose M4 uses the syntax ${{11}} to refer to
argument 11?  Or (if you prefer something shorter) ${+11}?  An
advantage to this sort of approach is that it gives you more leeway
for future extensions.

You have a reasonable point there. My current plan was to add new syntax
categories that could be controlled through the changesyntax builtin
(available in beta since at least 1.4o several years ago). So using $<1> instead of ${1} is easy - just use changesyntax([{<], [}>]) up front in m4sugar. On the other hand, supporting a multi-character delimiter that
is still selectable by the m4 user is a bit tougher; I would need to
introduce a new macro similar to changequote and changecom (perhaps
changeextarg({{, }}) for choosing ${{1}} to mean an m4-parsed extended
argument, leaving ${1} for literal output).

The intention with m4-2.0 and beyond was to make the rescanning engine
become modular enough that it would be possible to select a ``language''.
For example we already have 3 such languages (albeit implemented outside
the current module system): traditional, gnu, and posix.  Ultimately,
we should freeze core parsing issues to make an ``autoconf'' language,
which autoconf-3.0 could extend with modules it chose to ship.  Also,
I'd like to have an m5 language (Prof Dain Samples extended m4), and
to split gnu into gnu-m4 (1.4.x syntax) and gnu-m42 (2.0 extensions).

Considering how little time I've had for gnu recently, I think it is
fine to push these ideas out past the 2.0 release, though the default
configuration of m4-2.0 (and beyond) should be fully compatible with
m4-1.4 -- any syntax improvements or extensions are the remit of

  ())_.              Email me: address@hidden
  ( '/           Read my blog:
  / )=         ...and my book:
`(_~)_ Join my AGLOCO Network:

Attachment: PGP.sig
Description: This is a digitally signed message part

reply via email to

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