machine instructions. Strachey was a brilliant
programmer!
The three predecessors mentioned above were, in chronological
order, written in Snobol 3, Fortran, and Ratfor, so their
source code looked far less similar than their behaviors.
Doug McIlroy
I ran into a problem where $N is interpreted as a macro argument,
but I wanted a dollar amount.
A well constructed document likely doesn't interleave macro definitions
with the text that contains the dollar signs you want to protect. In that
case an easy fix is to transliterate the literal
A special option for each command, e.g. -o in sort and --in-place
I have been writing a lot of recursive m4 macros lately, and
have been disappointed to see that m4 doesn't recognize tail
calls and drop the dead stack frame when one occurs. A vivid
example is to watch memory usage for this trivial example.
define(x,`x')
x()
It needlessly eats
> is the answer to do this in multiple passes with different sets of macros?
Other possibilities:
1. A single output stream interspersed with diversion tags to be
postprocessed by, say, an awk script to distribute it to the
several files.
2. Use syscmd to deliver fragments to files: "echo stuff
Consider this predicate on strings.
define(eq,`define(`_$1',F)define(`_2',T)_$1')
eq(x,y) yields T or F according as strings x and y are
the same or different. (The strings may contain only
characters allowed in macro names).
The puzzle: If you omit inner quotes from the definition,
eq(A,A)
> I've had occasion to change the left / opening and right / closing quite
> in m4 a few times. I usually change it to a left / opening and right /
> closing bracket / brace, which ever is best for what I'm doing.
Useful feedback. Even "at home" with ASCII m4's left-quote character
causes
It's hard to conceive how you got bash bu not make. Try "which make". If
that comes up dry, get a copy of make from wherever you got bash. If it
says you have make, then you have a strange $PATH, or the install script
is playing with it. The latter is unlikely in an ordinary gnu install
such as
For a demonstration of the power of m4 stripped to the
bare minimum--no builtins other than `define'--see
www.cs.dartmouth.edu/~doug/barem4.txt. (Because browsers
may not like .m4 files, it's called .txt--but is not
Windows format.) Well-commented code builds quickly from
nothing to binary