m4-discuss
[Top][All Lists]
Advanced

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

RE: m4 process hang


From: Verma, Nitin \(GE Consumer & Industrial\)
Subject: RE: m4 process hang
Date: Thu, 27 May 2004 14:14:32 +0530

Even this feed will hang.
---------------
define(`x', `y')
x
define(`y', `x')
y
---------------
It's a infinite loop, y expands to x then x expands to y then y expands to x ... and so on so for
 
Am I right?
 
and better way to write this feed is:
 
-----------------
define(`x', ``y'')
x
define(`y', ``x'')
y
-----------------
 
or
 
My old feed as
------------------
define(`x', `y')
x
define(x, ``y'')
y
------------------
i.e:
x = y
y = `y'
so, now y's expansion is y quoted
 
not
------------------
define(x, y)
x
define(x, y)
y
------------------
i.e.
x=y
y=y
so, now y's expansion is y unquoted ... and the problem starts
 


 
-----Original Message-----
From: address@hidden [mailto:address@hiddenOn Behalf Of Verma, Nitin (GE Consumer & Industrial)
Sent: Wednesday, May 26, 2004 9:37 PM
To: address@hidden
Subject: m4 process hang

Hi Team,
 
I am very new to m4 macros, I effort to learn m4 macro writing. I can across this behavior.
I just made a file `try'
 
[neo]$ cat try
define(x, y)
x
define(x, y)
y
[neo]$
 
And fed to m4
 
[neo]$ m4 try
 
y
 
 
(hangs)
 
Now if I write
 
[neo]$ cat try
define(x, y)
x
define(x, y)
[neo]$
 
and the feed to m4
 
[neo]$ m4 try
 
y
 
[neo]$
 
it works as expected.
Am I doing something wrong?
 
[neo]$ m4 --version
GNU m4 1.4.1
[neo]$
 
Regards,
 
Nitin

reply via email to

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