m4-discuss
[Top][All Lists]
Advanced

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

Re: Newbie - having difficulty with a macro


From: John Christopher
Subject: Re: Newbie - having difficulty with a macro
Date: Sat, 1 Nov 2008 05:41:28 -0700 (PDT)

Thank you for replying.

I just noticed that if I change
    m4_define(`MACRO1', `%d foo, bar %d')
to
    m4_define(`MACRO1', `%d foo bar %d')
(remove the comma),
I get the following (desired) output:

3 foo bar 2

I could be wrong, but this seems like a bug,
unless there is something I don't understand
about the behavior of commas within a quoted
string.



--- On Sat, 11/1/08, Jack Woehr <address@hidden> wrote:

> From: Jack Woehr <address@hidden>
> Subject: Re: Newbie - having difficulty with a macro
> To: address@hidden
> Cc: address@hidden
> Date: Saturday, November 1, 2008, 4:37 AM
> John Christopher wrote:
> > I was expecting the output to be:
> > 3 foo, bar 2
> >
> > What am I doing wrong?
> > Thank you.
> >   
> define(`m1',`%d foo, bar %d')
> 
> format(m1, 3, 2)
> 0 foo
> define(`m1',`%d foo`,'bar %d')
> 
> format(m1, 3, 2)
> 3 foo,bar 2
> 
> -- 
> Jack J. Woehr            # "Self-delusion is
> http://www.well.com/~jax #  half the battle!"
> http://www.softwoehr.com #  - Zippy the Pinhead



      





reply via email to

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