Version 5 of m4

Updated 2005-05-28 09:30:20

String substitution language, a more general macro facility than the C preprocessor, first really publicised as the macro processor for Ratfor in the book Software Tools. It's a sophisticated language, but tricky to use because there's no unique substitution symbol to distinguish macros from ordinary running text.

The GNU m4 home page is [L1 ].


DKF: M4 is Turing-Complete, but only really used for autoconf hacking now (and that's a fairly heavily modified version).

Peter da Silva: It's also used in sendmail for automating the generation of config files.

Back around '82, after I left Berkeley, I was using RSX-11 and feeling UNIX-starved. I took a copy of Software Tools and implemented everything in it from Ratfor through ed. When I implemented macro I renamed all the internal symbols so they began with a dollar sign. This made a huge difference in the usability of the language.


[L2 ] explains the basic syntax of m4, although it is mostly about m4 quoting hell.


LV So, are there enough benefits to m4 to make it worth a developer's time to use it with Tcl to write sort of metacode, which would be expanded before execution?


Category Language