m4-discuss
[Top][All Lists]
Advanced

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

How does one define a closure in m4?


From: Jack J. Woehr
Subject: How does one define a closure in m4?
Date: Fri, 06 Sep 2013 21:44:59 -0600
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:23.0) Gecko/20100101 Firefox/23.0 SeaMonkey/2.20

How does one define a closure in m4?
define(`a',`$1 $2 and $3')
define(`b', `define(my_$1, `a( $1, `$1' ,`$2')')')
b(c)
my_c(x,y)
==> c c  and
What is wanted is
my_c(x,y)
to expand to
==> c  x and y
I've tried many tricks and quoting schemes, I'm missing something basic here.

-- 
Jack J. Woehr     # For in the idea of chess and the development
www.well.com/~jax # of the chess mind we have a picture of the 
www.softwoehr.com # intellectual struggle of mankind. – Richard Reti

reply via email to

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