bug-m4
[Top][All Lists]
Advanced

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

RE: FW: gnu m4


From: Daniel Deptford
Subject: RE: FW: gnu m4
Date: Mon, 29 Nov 2004 19:17:42 -0000

Thanks a lot!

I've got my more complicated macro definitions working now :)

This stuff is great for auto-generating .cpp and .h files, god the c
macro preprocessor sucks :)

Cheers,

Daniel

-----Original Message-----
From: Gary V. Vaughan [mailto:address@hidden 
Sent: 29 November 2004 18:32
To: Daniel Deptford
Cc: address@hidden
Subject: Re: FW: gnu m4

Hi Daniel,

You're not quoting correctly!

Daniel Deptford wrote:
> I'm using the gnu m4 macro processing utility, but I've got a little
> problem.  To put it simply, I want to supply macros as a parameters to
> other macros for them to execute with an argument list.
> 
>  
> 
> define(foo, $1)
> 
> define(bar, $1($2) )
> 
> bar(foo, fwap)

This evaluates to:

bar( , fwap)

since the first parameter is calling foo with no arguments.

You should have put:

bar(`foo', `fwap')

so that when bar is called, foo hasn't been expanded yet.

HTH,
        Gary.
-- 
Gary V. Vaughan      ())_.  address@hidden,gnu.org}
Research Scientist   ( '/   http://tkd.kicks-ass.net
GNU Hacker           / )=   http://www.gnu.org/software/libtool
Technical Author   `(_~)_   http://sources.redhat.com/autobook





reply via email to

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