> Date: Sat, 02 Feb 2002 09:34:31 -0800 > From: Bruce Korb <[EMAIL PROTECTED]>
> > 1. Replace only _unmatched_ [s and ]s with quadigraphs. > > Which means writing a special purpose C routine that has no > purpose outside of the "special" needs of autoconf. The basic idea is fairly general purpose -- for example, they can be used to generate Internet RFC 2822 comments, which use nested ( and ) -- though of course the particular quoting symbols are specific to Autoconf. (It doesn't need to be written in C, of course.) > This is severe uglitude. Mostly because it is fuzzy. The documentation is trying to show you the corner cases of M4, so that you know where all the bodies are buried. With that in mind, no wonder it's ugly: it's trying to show you the worst parts of the system. I don't see the fuzziness that you see. > define([car], [$1]) > define([active], [ACT, IVE]) > define([array], [int tab[10]]) > > Q: What happens to ``car([int array[5]])'' ? car([int array[5]]) --> int array[5] --> int int tab[10]5 --> int int tab105 > To ``car([[int array[5]]])'' ? car([[int array[5]]]) --> [int array[5]] --> int array[5] This is all pretty straightforward once you know the M4 rules. > In any case, it leaves me wondering if, in general, all arguments to > all macros should be double quoted No. > or is it particular arguments to particular macros In general, you should double-quote arguments if and only if you don't want macro evaluation to occur within them. > the author of each template file (read: macro or macro collection) > chooses the start/end quote markers that are guaranteed unique > within that template. I don't see how that can work in all cases with the current Autoconf and M4. I think we would need to add changequote nesting, along the lines of what you mentioned later in your message.