On Mon, Aug 16, 2010 at 10:33:22PM +0200, Ralf Wildenhues wrote: > Hello Randall, > > * Randall Cotton wrote on Mon, Aug 16, 2010 at 10:16:57PM CEST: > > [AS_IF([test "x$$1" = x""$2], [$3], [$4])], > > ...here ^^^^ > > AS_IF([test "x$as_val" = x""$2], [$3], [$4])])]) > > ...AND here ^^^^ > > > > It seems likely that x""$2 was meant to be "x$2". > > No, this code is really meant to be like this. The "" serve as > convenient separator that avoid that x and $2 can form the name of a m4 > macro upon expansion.
Thanks for clearing this up for me 8-) It's a subtle, but potentially crucial feature, not a bug. And really, there would be a bug without it. On Mon, Aug 16, 2010 at 02:38:12PM -0600, Eric Blake wrote: > > On 08/16/2010 02:33 PM, Ralf Wildenhues wrote: > >> But the documentation makes no mention that this is required. > > > > Then the documentation needs fixing. > > Agreed. > > Something along the lines of stating that <value> must be a shell word, > and then giving an example with a string containing quotes and spacing > would be appropriate. I would suggest something along the lines of the existing documentation for AS_ECHO and AS_ECHO_N. Both feature the statement: "word must be a single shell word (typically a quoted string)" ^^^^ Here, "word" is italicized because the synopsis uses that label to represent the argument to AS_ECHO (and AS_ECHO_N). So I'm also suggesting that rather than using the label "value" in the synopsis for the second argument of AS_VAR_IF, use "word", again as AS_ECHO and AS_ECHO_N do. Randall Cotton