m4/examples/forloop.m4
Eric Blake b9d7924e31 * tests/generate.awk: For ease of doc-writing, simplify selection
of '-Ipath/to/examples' to '@comment examples'.
* examples/forloop.m4: Simplify.
* examples/forloop2.m4: New file.
* examples/quote.m4: New file.
* doc/m4.texinfo (Improved forloop): New node.
(Manual): Clarify use of examples directory.
(Shift, Forloop): Resync from branch.
(Include, Location): Update to new usage of examples directory.
2007-10-06 07:07:07 -06:00

7 lines
224 B
Plaintext

divert(`-1')
# forloop(var, from, to, stmt) - simple version
define(`forloop', `pushdef(`$1', `$2')_forloop($@)popdef(`$1')')
define(`_forloop',
`$4`'ifelse($1, `$3', `', `define(`$1', incr($1))$0($@)')')
divert`'dnl