M4The term M4 has several meanings:
- The " title="M4 motorway">M4 motorway is a major " title="Britain">British motorway which runs from Chiswick, west of " title="London">London, into " title="Wales">Wales.
- The M4 is also a motorway in " title="Sydney">Sydney, " title="Australia">Australia, running from the western suburb of Emu Plains to the inner western suburb of Strathfield.
- The " title="M4 Carbine">M4 Carbine is also a " title="Carbine">carbine version of the " title="M16">M16 " title="Rifle">rifle.
- M4 is also " title="Messier object">Messier object M4, or " title="Messier 4">Messier 4, also known as " title="Messier 4">NGC 6121, a " title="Globular cluster">globular cluster in the constellation of " title="Scorpius">Scorpius.
M4 is a " title="Macro">macro processing language.
A list of M4 resources may be found at http://www.m4site.com A macro processor is a text-replacement tool. Its chief use is to re-use text templates, typically in " title="Computer programming">programming applications, but also in text editing, text processing applications.
Macro processors were prevalent when " title="Assembly language">assembly language programming was the common tool of programmers. In these early days of programming, the programmers noted that much of their program was repeated text. Simple means to re-use this text were invented. Programmers soon discovered it easy to not only reuse entire blocks of text, but, on occasion, substitute different values for similar parameters. This defined the usage range of macro processors.
M4 offers these facilities:
- text replacement
- parameter substitution
- file inclusion
- string manipulation
- conditional evaluation
- arithmetic expressions
- system interface
- programmer diagnostics
define(`Name', `A very very long name')After being processed with m4:
m4 inputfile >outputfileThe outputfile will look like
printf("A very very long name\\n")
There is a " title="GNU m4">GNU version of m4.