[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: M4 syntax $11 vs. ${11}
From: |
Ralf Wildenhues |
Subject: |
Re: M4 syntax $11 vs. ${11} |
Date: |
Mon, 29 Jan 2007 19:44:38 +0100 |
User-agent: |
Mutt/1.5.13 (2006-08-11) |
Hello Eric, all,
* Eric Blake wrote on Sun, Jan 28, 2007 at 06:05:48AM CET:
>
> * lib/m4sugar/m4sugar.m4: Cripple ${1} expansion in M4 2.0 for
> portability with 1.4.x behavior.
> * doc/autoconf.texi (Quoting and Parameters): New section.
> (Quotation and Nested Macros): Touch up example.
> * NEWS: Document the new limitation on user macros not exceeding
> $9.
[...]
This makes things inconsistent. Quoting `Coding Style':
| Otherwise, the closing bracket would be hidden inside a `#'-comment,
| breaking the bracket-matching highlighting from Emacsen. Note the
| preferred style to escape from M4: `$[1]', address@hidden', etc. Do not
escape
| when it is unnecessary. Common examples of useless quotation are
| `[$]$1' (write `$$1'), `[$]var' (use `$var'), etc. If you add
| portability issues to the picture, you'll prefer `${1+"address@hidden"}' to
| `"[$]@"', and you'll prefer do something better than hacking Autoconf
| `:-)'.
The Coding Style ends up being inconsistent with
$[#] where it's necessary to quote the hash,
$[1] where either character could be quoted,
[$]{1...} vs. $[{1...}] vs. $[{]1...}
where the first is inconsistent with the
previous examples, and the others are ugly,
and is not applied throughout the manual (see the `${1+"address@hidden"}' at the
end of the quoted paragraph).
IMHO, it's not a good idea to not "practice what we preach" in any
direction: either have the code be more cautious than the documentation,
or vice versa.
(But maybe you have arrived at another iteration of the patch already,
obsoleting my comments; I haven't seen any newer patch, though.)
Cheers,
Ralf