Parent Directory | Revision Log | Patch
revision 1.1.1.1.2.3 by gary, Thu Sep 9 21:10:27 2004 UTC | revision 1.1.1.1.2.4 by gary, Thu Feb 3 15:21:06 2005 UTC | |
---|---|---|
# | Line 1 | Line 1 |
1 | This is m4.info, produced by makeinfo version 4.7 from m4.texinfo. | This is m4.info, produced by makeinfo version 4.6 from m4.texinfo. |
2 | ||
3 | START-INFO-DIR-ENTRY | START-INFO-DIR-ENTRY |
4 | * m4: (m4). A powerful macro processor. | * m4: (m4). A powerful macro processor. |
# | Line 48 documentation. However... | Line 48 documentation. However... |
48 | An experimental feature, which would improve `m4' usefulness, allows | An experimental feature, which would improve `m4' usefulness, allows |
49 | for changing the syntax for what is a "word" in `m4'. You should use: | for changing the syntax for what is a "word" in `m4'. You should use: |
50 | ./configure --enable-changeword | ./configure --enable-changeword |
51 | if you want this feature compiled in. The current implementation | |
52 | slows down `m4' considerably and is hardly acceptable. So, it might go | if you want this feature compiled in. The current implementation slows |
53 | away, do not count on it yet. | down `m4' considerably and is hardly acceptable. So, it might go away, |
54 | do not count on it yet. | |
55 | ||
56 | * Menu: | * Menu: |
57 | ||
# | Line 184 Compatibility with other versions of `m4 | Line 185 Compatibility with other versions of `m4 |
185 | ||
186 | File: m4.info, Node: Preliminaries, Next: Syntax, Prev: Top, Up: Top | File: m4.info, Node: Preliminaries, Next: Syntax, Prev: Top, Up: Top |
187 | ||
188 | 1 Introduction and preliminaries | Introduction and preliminaries |
189 | ******************************** | ****************************** |
190 | ||
191 | This first chapter explains what is GNU `m4', where `m4' comes from, | This first chapter explains what is GNU `m4', where `m4' comes from, |
192 | how to read and use this documentation, how to call the `m4' program | how to read and use this documentation, how to call the `m4' program |
# | Line 206 language. | Line 207 language. |
207 | ||
208 | File: m4.info, Node: Intro, Next: History, Prev: Preliminaries, Up: Preliminaries | File: m4.info, Node: Intro, Next: History, Prev: Preliminaries, Up: Preliminaries |
209 | ||
210 | 1.1 Introduction to `m4' | Introduction to `m4' |
211 | ======================== | ==================== |
212 | ||
213 | `m4' is a macro processor, in the sense that it copies its input to the | `m4' is a macro processor, in the sense that it copies its input to the |
214 | output, expanding macros as it goes. Macros are either builtin or | output, expanding macros as it goes. Macros are either builtin or |
# | Line 237 the health of compulsive programmers. | Line 238 the health of compulsive programmers. |
238 | ||
239 | File: m4.info, Node: History, Next: Invoking m4, Prev: Intro, Up: Preliminaries | File: m4.info, Node: History, Next: Invoking m4, Prev: Intro, Up: Preliminaries |
240 | ||
241 | 1.2 Historical references | Historical references |
242 | ========================= | ===================== |
243 | ||
244 | The historical notes included here are fairly incomplete, and not | The historical notes included here are fairly incomplete, and not |
245 | authoritative at all. Please knowledgeable users help us to more | authoritative at all. Please knowledgeable users help us to more |
# | Line 260 that is, the `ratfor' equivalent of `cpp | Line 261 that is, the `ratfor' equivalent of `cpp |
261 | ||
262 | File: m4.info, Node: Invoking m4, Next: Bugs, Prev: History, Up: Preliminaries | File: m4.info, Node: Invoking m4, Next: Bugs, Prev: History, Up: Preliminaries |
263 | ||
264 | 1.3 Invoking `m4' | Invoking `m4' |
265 | ================= | ============= |
266 | ||
267 | The format of the `m4' command is: | The format of the `m4' command is: |
268 | ||
# | Line 444 the command line. | Line 445 the command line. |
445 | ||
446 | File: m4.info, Node: Bugs, Next: Manual, Prev: Invoking m4, Up: Preliminaries | File: m4.info, Node: Bugs, Next: Manual, Prev: Invoking m4, Up: Preliminaries |
447 | ||
448 | 1.4 Problems and bugs | Problems and bugs |
449 | ===================== | ================= |
450 | ||
451 | If you have problems with GNU `m4' or think you've found a bug, please | If you have problems with GNU `m4' or think you've found a bug, please |
452 | report it. Before reporting a bug, make sure you've actually found a | report it. Before reporting a bug, make sure you've actually found a |
# | Line 473 just obscure features, please report the | Line 474 just obscure features, please report the |
474 | ||
475 | File: m4.info, Node: Manual, Prev: Bugs, Up: Preliminaries | File: m4.info, Node: Manual, Prev: Bugs, Up: Preliminaries |
476 | ||
477 | 1.5 Using this manual | Using this manual |
478 | ===================== | ================= |
479 | ||
480 | This manual contains a number of examples of `m4' input and output, and | This manual contains a number of examples of `m4' input and output, and |
481 | a simple notation is used to distinguish input, output and error | a simple notation is used to distinguish input, output and error |
# | Line 512 primitive is spelled within `m4'. | Line 513 primitive is spelled within `m4'. |
513 | ||
514 | File: m4.info, Node: Syntax, Next: Macros, Prev: Preliminaries, Up: Top | File: m4.info, Node: Syntax, Next: Macros, Prev: Preliminaries, Up: Top |
515 | ||
516 | 2 Lexical and syntactic conventions | Lexical and syntactic conventions |
517 | *********************************** | ********************************* |
518 | ||
519 | As `m4' reads its input, it separates it into "tokens". A token is | As `m4' reads its input, it separates it into "tokens". A token is |
520 | either a name, a quoted string, or any single character, that is not a | either a name, a quoted string, or any single character, that is not a |
# | Line 530 comments. | Line 531 comments. |
531 | ||
532 | File: m4.info, Node: Names, Next: Quoted strings, Prev: Syntax, Up: Syntax | File: m4.info, Node: Names, Next: Quoted strings, Prev: Syntax, Up: Syntax |
533 | ||
534 | 2.1 Names | Names |
535 | ========= | ===== |
536 | ||
537 | A name is any sequence of letters, digits, and the character `_' | A name is any sequence of letters, digits, and the character `_' |
538 | (underscore), where the first character is not a digit. If a name has | (underscore), where the first character is not a digit. If a name has |
# | Line 543 Macros::). | Line 544 Macros::). |
544 | ||
545 | File: m4.info, Node: Quoted strings, Next: Other tokens, Prev: Names, Up: Syntax | File: m4.info, Node: Quoted strings, Next: Other tokens, Prev: Names, Up: Syntax |
546 | ||
547 | 2.2 Quoted strings | Quoted strings |
548 | ================== | ============== |
549 | ||
550 | A quoted string is a sequence of characters surrounded by the quotes | A quoted string is a sequence of characters surrounded by the quotes |
551 | ``' and `'', where the number of start and end quotes within the string | ``' and `'', where the number of start and end quotes within the string |
# | Line 567 macro `changequote'. *Note Changequote: | Line 568 macro `changequote'. *Note Changequote: |
568 | ||
569 | File: m4.info, Node: Other tokens, Next: Comments, Prev: Quoted strings, Up: Syntax | File: m4.info, Node: Other tokens, Next: Comments, Prev: Quoted strings, Up: Syntax |
570 | ||
571 | 2.3 Other tokens | Other tokens |
572 | ================ | ============ |
573 | ||
574 | Any character, that is neither a part of a name, nor of a quoted string, | Any character, that is neither a part of a name, nor of a quoted string, |
575 | is a token by itself. | is a token by itself. |
# | Line 576 is a token by itself. | Line 577 is a token by itself. |
577 | ||
578 | File: m4.info, Node: Comments, Prev: Other tokens, Up: Syntax | File: m4.info, Node: Comments, Prev: Other tokens, Up: Syntax |
579 | ||
580 | 2.4 Comments | Comments |
581 | ============ | ======== |
582 | ||
583 | Comments in `m4' are normally delimited by the characters `#' and | Comments in `m4' are normally delimited by the characters `#' and |
584 | newline. All characters between the comment delimiters are ignored, | newline. All characters between the comment delimiters are ignored, |
# | Line 595 information. | Line 596 information. |
596 | ||
597 | File: m4.info, Node: Macros, Next: Definitions, Prev: Syntax, Up: Top | File: m4.info, Node: Macros, Next: Definitions, Prev: Syntax, Up: Top |
598 | ||
599 | 3 How to invoke macros | How to invoke macros |
600 | ********************** | ******************** |
601 | ||
602 | This chapter covers macro invocation, macro arguments and how macro | This chapter covers macro invocation, macro arguments and how macro |
603 | expansion is treated. | expansion is treated. |
# | Line 612 expansion is treated. | Line 613 expansion is treated. |
613 | ||
614 | File: m4.info, Node: Invocation, Next: Inhibiting Invocation, Prev: Macros, Up: Macros | File: m4.info, Node: Invocation, Next: Inhibiting Invocation, Prev: Macros, Up: Macros |
615 | ||
616 | 3.1 Macro invocation | Macro invocation |
617 | ==================== | ================ |
618 | ||
619 | Macro invocations has one of the forms | Macro invocations has one of the forms |
620 | ||
# | Line 642 with no arguments. | Line 643 with no arguments. |
643 | ||
644 | File: m4.info, Node: Inhibiting Invocation, Next: Macro Arguments, Prev: Invocation, Up: Macros | File: m4.info, Node: Inhibiting Invocation, Next: Macro Arguments, Prev: Invocation, Up: Macros |
645 | ||
646 | 3.2 Preventing macro invocation | Preventing macro invocation |
647 | =============================== | =========================== |
648 | ||
649 | An innovation of the `m4' language, compared to some of its | An innovation of the `m4' language, compared to some of its |
650 | predecessors (like Stratchey's `GPM', for example), is the ability to | predecessors (like Stratchey's `GPM', for example), is the ability to |
# | Line 724 the `divert' builtin would be called ins | Line 725 the `divert' builtin would be called ins |
725 | ||
726 | File: m4.info, Node: Macro Arguments, Next: Quoting Arguments, Prev: Inhibiting Invocation, Up: Macros | File: m4.info, Node: Macro Arguments, Next: Quoting Arguments, Prev: Inhibiting Invocation, Up: Macros |
727 | ||
728 | 3.3 Macro arguments | Macro arguments |
729 | =================== | =============== |
730 | ||
731 | When a name is seen, and it has a macro definition, it will be expanded | When a name is seen, and it has a macro definition, it will be expanded |
732 | as a macro. | as a macro. |
# | Line 755 but trailing whitespace always is. | Line 756 but trailing whitespace always is. |
756 | ||
757 | File: m4.info, Node: Quoting Arguments, Next: Macro expansion, Prev: Macro Arguments, Up: Macros | File: m4.info, Node: Quoting Arguments, Next: Macro expansion, Prev: Macro Arguments, Up: Macros |
758 | ||
759 | 3.4 Quoting macro arguments | Quoting macro arguments |
760 | =========================== | ======================= |
761 | ||
762 | Each argument has leading unquoted whitespace removed. Within each | Each argument has leading unquoted whitespace removed. Within each |
763 | argument, all unquoted parentheses must match. For example, if FOO is | argument, all unquoted parentheses must match. For example, if FOO is |
# | Line 779 life a bit harder, if you are not carefu | Line 780 life a bit harder, if you are not carefu |
780 | ||
781 | File: m4.info, Node: Macro expansion, Prev: Quoting Arguments, Up: Macros | File: m4.info, Node: Macro expansion, Prev: Quoting Arguments, Up: Macros |
782 | ||
783 | 3.5 Macro expansion | Macro expansion |
784 | =================== | =============== |
785 | ||
786 | When the arguments, if any, to a macro call have been collected, the | When the arguments, if any, to a macro call have been collected, the |
787 | macro is expanded, and the expansion text is pushed back onto the input | macro is expanded, and the expansion text is pushed back onto the input |
# | Line 799 will expand first to `bar', and when thi | Line 800 will expand first to `bar', and when thi |
800 | ||
801 | File: m4.info, Node: Definitions, Next: Conditionals, Prev: Macros, Up: Top | File: m4.info, Node: Definitions, Next: Conditionals, Prev: Macros, Up: Top |
802 | ||
803 | 4 How to define new macros | How to define new macros |
804 | ************************** | ************************ |
805 | ||
806 | Macros can be defined, redefined and deleted in several different ways. | Macros can be defined, redefined and deleted in several different ways. |
807 | Also, it is possible to redefine a macro, without losing a previous | Also, it is possible to redefine a macro, without losing a previous |
# | Line 821 value, which can be brought back at a la | Line 822 value, which can be brought back at a la |
822 | ||
823 | File: m4.info, Node: Define, Next: Arguments, Prev: Definitions, Up: Definitions | File: m4.info, Node: Define, Next: Arguments, Prev: Definitions, Up: Definitions |
824 | ||
825 | 4.1 Defining a macro | Defining a macro |
826 | ==================== | ================ |
827 | ||
828 | The normal way to define or redefine macros is to use the builtin | The normal way to define or redefine macros is to use the builtin |
829 | `define': | `define': |
# | Line 852 for details. | Line 853 for details. |
853 | ||
854 | File: m4.info, Node: Arguments, Next: Pseudo Arguments, Prev: Define, Up: Definitions | File: m4.info, Node: Arguments, Next: Pseudo Arguments, Prev: Define, Up: Definitions |
855 | ||
856 | 4.2 Arguments to macros | Arguments to macros |
857 | ======================= | =================== |
858 | ||
859 | Macros can have arguments. The Nth argument is denoted by `$n' in the | Macros can have arguments. The Nth argument is denoted by `$n' in the |
860 | expansion text, and is replaced by the Nth actual argument, when the | expansion text, and is replaced by the Nth actual argument, when the |
# | Line 903 string, and not a name. | Line 904 string, and not a name. |
904 | ||
905 | File: m4.info, Node: Pseudo Arguments, Next: Undefine, Prev: Arguments, Up: Definitions | File: m4.info, Node: Pseudo Arguments, Next: Undefine, Prev: Arguments, Up: Definitions |
906 | ||
907 | 4.3 Special arguments to macros | Special arguments to macros |
908 | =============================== | =========================== |
909 | ||
910 | There is a special notation for the number of actual arguments supplied, | There is a special notation for the number of actual arguments supplied, |
911 | and for all the actual arguments. | and for all the actual arguments. |
# | Line 971 sign as a reference to an argument. | Line 972 sign as a reference to an argument. |
972 | ||
973 | File: m4.info, Node: Undefine, Next: Defn, Prev: Pseudo Arguments, Up: Definitions | File: m4.info, Node: Undefine, Next: Defn, Prev: Pseudo Arguments, Up: Definitions |
974 | ||
975 | 4.4 Deleting a macro | Deleting a macro |
976 | ==================== | ================ |
977 | ||
978 | A macro definition can be removed with `undefine': | A macro definition can be removed with `undefine': |
979 | ||
# | Line 1002 case, `undefine' does nothing. | Line 1003 case, `undefine' does nothing. |
1003 | ||
1004 | File: m4.info, Node: Defn, Next: Pushdef, Prev: Undefine, Up: Definitions | File: m4.info, Node: Defn, Next: Pushdef, Prev: Undefine, Up: Definitions |
1005 | ||
1006 | 4.5 Renaming macros | Renaming macros |
1007 | =================== | =============== |
1008 | ||
1009 | It is possible to rename an already defined macro. To do this, you need | It is possible to rename an already defined macro. To do this, you need |
1010 | the builtin `defn': | the builtin `defn': |
# | Line 1038 the other name can still be used to acce | Line 1039 the other name can still be used to acce |
1039 | ||
1040 | File: m4.info, Node: Pushdef, Next: Indir, Prev: Defn, Up: Definitions | File: m4.info, Node: Pushdef, Next: Indir, Prev: Defn, Up: Definitions |
1041 | ||
1042 | 4.6 Temporarily redefining macros | Temporarily redefining macros |
1043 | ================================= | ============================= |
1044 | ||
1045 | It is possible to redefine a macro temporarily, reverting to the | It is possible to redefine a macro temporarily, reverting to the |
1046 | previous definition at a later time. This is done with the builtins | previous definition at a later time. This is done with the builtins |
# | Line 1108 parameters. | Line 1109 parameters. |
1109 | ||
1110 | File: m4.info, Node: Indir, Next: Builtin, Prev: Pushdef, Up: Definitions | File: m4.info, Node: Indir, Next: Builtin, Prev: Pushdef, Up: Definitions |
1111 | ||
1112 | 4.7 Indirect call of macros | Indirect call of macros |
1113 | =========================== | ======================= |
1114 | ||
1115 | Any macro can be called indirectly with `indir': | Any macro can be called indirectly with `indir': |
1116 | ||
1117 | indir(NAME, ...) | indir(NAME, ...) |
1118 | which results in a call to the macro NAME, which is passed the rest | |
1119 | of the arguments. This can be used to call macros with "illegal" names | which results in a call to the macro NAME, which is passed the rest of |
1120 | the arguments. This can be used to call macros with "illegal" names | |
1121 | (`define' allows such names to be defined): | (`define' allows such names to be defined): |
1122 | ||
1123 | define(`$$internal$macro', `Internal macro (name `$0')') | define(`$$internal$macro', `Internal macro (name `$0')') |
# | Line 1132 called through the builtin `indir'. | Line 1134 called through the builtin `indir'. |
1134 | ||
1135 | File: m4.info, Node: Builtin, Prev: Indir, Up: Definitions | File: m4.info, Node: Builtin, Prev: Indir, Up: Definitions |
1136 | ||
1137 | 4.8 Indirect call of builtins | Indirect call of builtins |
1138 | ============================= | ========================= |
1139 | ||
1140 | Builtin macros can be called indirectly with `builtin': | Builtin macros can be called indirectly with `builtin': |
1141 | ||
1142 | builtin(NAME, ...) | builtin(NAME, ...) |
1143 | which results in a call to the builtin NAME, which is passed the | |
1144 | rest of the arguments. This can be used, if NAME has been given | which results in a call to the builtin NAME, which is passed the rest |
1145 | another definition that has covered the original. | of the arguments. This can be used, if NAME has been given another |
1146 | definition that has covered the original. | |
1147 | ||
1148 | The macro `builtin' is recognized only with parameters. | The macro `builtin' is recognized only with parameters. |
1149 | ||
1150 | ||
1151 | File: m4.info, Node: Conditionals, Next: Debugging, Prev: Definitions, Up: Top | File: m4.info, Node: Conditionals, Next: Debugging, Prev: Definitions, Up: Top |
1152 | ||
1153 | 5 Conditionals, loops and recursion | Conditionals, loops and recursion |
1154 | *********************************** | ********************************* |
1155 | ||
1156 | Macros, expanding to plain text, perhaps with arguments, are not quite | Macros, expanding to plain text, perhaps with arguments, are not quite |
1157 | enough. We would like to have macros expand to different things, based | enough. We would like to have macros expand to different things, based |
# | Line 1166 true. | Line 1169 true. |
1169 | ||
1170 | File: m4.info, Node: Ifdef, Next: Ifelse, Prev: Conditionals, Up: Conditionals | File: m4.info, Node: Ifdef, Next: Ifelse, Prev: Conditionals, Up: Conditionals |
1171 | ||
1172 | 5.1 Testing macro definitions | Testing macro definitions |
1173 | ============================= | ========================= |
1174 | ||
1175 | There are two different builtin conditionals in `m4'. The first is | There are two different builtin conditionals in `m4'. The first is |
1176 | `ifdef': | `ifdef': |
# | Line 1191 STRING-2. If STRING-2 is omitted, it is | Line 1194 STRING-2. If STRING-2 is omitted, it is |
1194 | ||
1195 | File: m4.info, Node: Ifelse, Next: Loops, Prev: Ifdef, Up: Conditionals | File: m4.info, Node: Ifelse, Next: Loops, Prev: Ifdef, Up: Conditionals |
1196 | ||
1197 | 5.2 Comparing strings | Comparing strings |
1198 | ===================== | ================= |
1199 | ||
1200 | The other conditional, `ifelse', is much more powerful. It can be used | The other conditional, `ifelse', is much more powerful. It can be used |
1201 | as a way to introduce a long comment, as an if-else construct, or as a | as a way to introduce a long comment, as an if-else construct, or as a |
# | Line 1239 various kinds. | Line 1242 various kinds. |
1242 | ||
1243 | File: m4.info, Node: Loops, Prev: Ifelse, Up: Conditionals | File: m4.info, Node: Loops, Prev: Ifelse, Up: Conditionals |
1244 | ||
1245 | 5.3 Loops and recursion | Loops and recursion |
1246 | ======================= | =================== |
1247 | ||
1248 | There is no direct support for loops in `m4', but macros can be | There is no direct support for loops in `m4', but macros can be |
1249 | recursive. There is no limit on the number of recursion levels, other | recursive. There is no limit on the number of recursion levels, other |
# | Line 1331 the reader. | Line 1334 the reader. |
1334 | ||
1335 | File: m4.info, Node: Debugging, Next: Input Control, Prev: Conditionals, Up: Top | File: m4.info, Node: Debugging, Next: Input Control, Prev: Conditionals, Up: Top |
1336 | ||
1337 | 6 How to debug macros and input | How to debug macros and input |
1338 | ******************************* | ***************************** |
1339 | ||
1340 | When writing macros for `m4', most of the time they woould not work as | When writing macros for `m4', most of the time they woould not work as |
1341 | intended (as is the case with most programming languages). There is a | intended (as is the case with most programming languages). There is a |
# | Line 1348 little support for macro debugging in `m | Line 1351 little support for macro debugging in `m |
1351 | ||
1352 | File: m4.info, Node: Dumpdef, Next: Trace, Prev: Debugging, Up: Debugging | File: m4.info, Node: Dumpdef, Next: Trace, Prev: Debugging, Up: Debugging |
1353 | ||
1354 | 6.1 Displaying macro definitions | Displaying macro definitions |
1355 | ================================ | ============================ |
1356 | ||
1357 | If you want to see what a name expands into, you can use the builtin | If you want to see what a name expands into, you can use the builtin |
1358 | `dumpdef': | `dumpdef': |
# | Line 1380 the display. | Line 1383 the display. |
1383 | ||
1384 | File: m4.info, Node: Trace, Next: Debug Levels, Prev: Dumpdef, Up: Debugging | File: m4.info, Node: Trace, Next: Debug Levels, Prev: Dumpdef, Up: Debugging |
1385 | ||
1386 | 6.2 Tracing macro calls | Tracing macro calls |
1387 | ======================= | =================== |
1388 | ||
1389 | It is possible to trace macro calls and expansions through the builtins | It is possible to trace macro calls and expansions through the builtins |
1390 | `traceon' and `traceoff': | `traceon' and `traceoff': |
# | Line 1423 the display. | Line 1426 the display. |
1426 | ||
1427 | File: m4.info, Node: Debug Levels, Next: Debug Output, Prev: Trace, Up: Debugging | File: m4.info, Node: Debug Levels, Next: Debug Output, Prev: Trace, Up: Debugging |
1428 | ||
1429 | 6.3 Controlling debugging output | Controlling debugging output |
1430 | ================================ | ============================ |
1431 | ||
1432 | The `-d' option to `m4' controls the amount of details presented, when | The `-d' option to `m4' controls the amount of details presented, when |
1433 | using the macros described in the preceding sections. | using the macros described in the preceding sections. |
# | Line 1483 flags. | Line 1486 flags. |
1486 | control of the debugging output format: | control of the debugging output format: |
1487 | ||
1488 | debugmode(opt FLAGS) | debugmode(opt FLAGS) |
1489 | The argument FLAGS should be a subset of the letters listed above. | |
1490 | As special cases, if the argument starts with a `+', the flags are | The argument FLAGS should be a subset of the letters listed above. As |
1491 | added to the current debug flags, and if it starts with a `-', they are | special cases, if the argument starts with a `+', the flags are added |
1492 | to the current debug flags, and if it starts with a `-', they are | |
1493 | removed. If no argument is present, the debugging flags are set to | removed. If no argument is present, the debugging flags are set to |
1494 | zero (as if no `-d' was given), and with an empty argument the flags | zero (as if no `-d' was given), and with an empty argument the flags |
1495 | are reset to the default. | are reset to the default. |
# | Line 1493 are reset to the default. | Line 1497 are reset to the default. |
1497 | ||
1498 | File: m4.info, Node: Debug Output, Prev: Debug Levels, Up: Debugging | File: m4.info, Node: Debug Output, Prev: Debug Levels, Up: Debugging |
1499 | ||
1500 | 6.4 Saving debugging output | Saving debugging output |
1501 | =========================== | ======================= |
1502 | ||
1503 | Debug and tracing output can be redirected to files using either the | Debug and tracing output can be redirected to files using either the |
1504 | `-o' option to `m4', or with the builtin macro `debugfile': | `-o' option to `m4', or with the builtin macro `debugfile': |
1505 | ||
1506 | debugfile(opt FILENAME) | debugfile(opt FILENAME) |
1507 | will send all further debug and trace output to FILENAME. If | |
1508 | FILENAME is empty, debug and trace output are discarded and if | will send all further debug and trace output to FILENAME. If FILENAME |
1509 | `debugfile' is called without any arguments, debug and trace output are | is empty, debug and trace output are discarded and if `debugfile' is |
1510 | sent to the standard error output. | called without any arguments, debug and trace output are sent to the |
1511 | standard error output. | |
1512 | ||
1513 | ||
1514 | File: m4.info, Node: Input Control, Next: File Inclusion, Prev: Debugging, Up: Top | File: m4.info, Node: Input Control, Next: File Inclusion, Prev: Debugging, Up: Top |
1515 | ||
1516 | 7 Input control | Input control |
1517 | *************** | ************* |
1518 | ||
1519 | This chapter describes various builtin macros for controlling the input | This chapter describes various builtin macros for controlling the input |
1520 | to `m4'. | to `m4'. |
# | Line 1525 to `m4'. | Line 1530 to `m4'. |
1530 | ||
1531 | File: m4.info, Node: Dnl, Next: Changequote, Prev: Input Control, Up: Input Control | File: m4.info, Node: Dnl, Next: Changequote, Prev: Input Control, Up: Input Control |
1532 | ||
1533 | 7.1 Deleting whitespace in input | Deleting whitespace in input |
1534 | ================================ | ============================ |
1535 | ||
1536 | The builtin `dnl' reads and discards all characters, up to and | The builtin `dnl' reads and discards all characters, up to and |
1537 | including the first newline: | including the first newline: |
1538 | ||
1539 | dnl | dnl |
1540 | and it is often used in connection with `define', to remove the | |
1541 | newline that follow the call to `define'. Thus | and it is often used in connection with `define', to remove the newline |
1542 | that follow the call to `define'. Thus | |
1543 | ||
1544 | define(`foo', `Macro `foo'.')dnl A very simple macro, indeed. | define(`foo', `Macro `foo'.')dnl A very simple macro, indeed. |
1545 | foo | foo |
# | Line 1554 line containing it, will still be discar | Line 1560 line containing it, will still be discar |
1560 | ||
1561 | File: m4.info, Node: Changequote, Next: Changecom, Prev: Dnl, Up: Input Control | File: m4.info, Node: Changequote, Next: Changecom, Prev: Dnl, Up: Input Control |
1562 | ||
1563 | 7.2 Changing the quote characters | Changing the quote characters |
1564 | ================================= | ============================= |
1565 | ||
1566 | The default quote delimiters can be changed with the builtin | The default quote delimiters can be changed with the builtin |
1567 | `changequote': | `changequote': |
1568 | ||
1569 | changequote(opt START, opt END) | changequote(opt START, opt END) |
1570 | where START is the new start-quote delimiter and END is the new | |
1571 | where START is the new start-quote delimiter and END is the new | |
1572 | end-quote delimiter. If any of the arguments are missing, the default | end-quote delimiter. If any of the arguments are missing, the default |
1573 | quotes (``' and `'') are used instead of the void arguments. | quotes (``' and `'') are used instead of the void arguments. |
1574 | ||
# | Line 1606 the quoting mechanism. | Line 1613 the quoting mechanism. |
1613 | ||
1614 | File: m4.info, Node: Changecom, Next: Changeword, Prev: Changequote, Up: Input Control | File: m4.info, Node: Changecom, Next: Changeword, Prev: Changequote, Up: Input Control |
1615 | ||
1616 | 7.3 Changing comment delimiters | Changing comment delimiters |
1617 | =============================== | =========================== |
1618 | ||
1619 | The default comment delimiters can be changed with the builtin macro | The default comment delimiters can be changed with the builtin macro |
1620 | `changecom': | `changecom': |
1621 | ||
1622 | changecom(opt START, opt END) | changecom(opt START, opt END) |
1623 | where START is the new start-comment delimiter and END is the new | |
1624 | where START is the new start-comment delimiter and END is the new | |
1625 | end-comment delimiter. If any of the arguments are void, the default | end-comment delimiter. If any of the arguments are void, the default |
1626 | comment delimiters (`#' and newline) are used instead of the void | comment delimiters (`#' and newline) are used instead of the void |
1627 | arguments. The comment delimiters can be of any length. | arguments. The comment delimiters can be of any length. |
# | Line 1648 mechanism completely. | Line 1656 mechanism completely. |
1656 | ||
1657 | File: m4.info, Node: Changeword, Next: M4wrap, Prev: Changecom, Up: Input Control | File: m4.info, Node: Changeword, Next: M4wrap, Prev: Changecom, Up: Input Control |
1658 | ||
1659 | 7.4 Changing the lexical structure of words | Changing the lexical structure of words |
1660 | =========================================== | ======================================= |
1661 | ||
1662 | The macro `changeword' and all associated functionnality is | The macro `changeword' and all associated functionnality is |
1663 | experimental. It is only available if the `--enable-changeword' | experimental. It is only available if the `--enable-changeword' |
# | Line 1734 factor of about seven. | Line 1742 factor of about seven. |
1742 | ||
1743 | File: m4.info, Node: M4wrap, Prev: Changeword, Up: Input Control | File: m4.info, Node: M4wrap, Prev: Changeword, Up: Input Control |
1744 | ||
1745 | 7.5 Saving input | Saving input |
1746 | ================ | ============ |
1747 | ||
1748 | It is possible to `save' some text until the end of the normal input has | It is possible to `save' some text until the end of the normal input has |
1749 | been seen. Text can be saved, to be read again by `m4' when the normal | been seen. Text can be saved, to be read again by `m4' when the normal |
# | Line 1745 cleanup actions before normal exit, e.g. | Line 1753 cleanup actions before normal exit, e.g. |
1753 | To save input text, use the builtin `m4wrap': | To save input text, use the builtin `m4wrap': |
1754 | ||
1755 | m4wrap(STRING, ...) | m4wrap(STRING, ...) |
1756 | which stores STRING and the rest of the arguments in a safe place, | |
1757 | to be reread when end of input is reached. | which stores STRING and the rest of the arguments in a safe place, to |
1758 | be reread when end of input is reached. | |
1759 | ||
1760 | define(`cleanup', `This is the `cleanup' actions. | define(`cleanup', `This is the `cleanup' actions. |
1761 | ') | ') |
# | Line 1769 in which they were saved (LIFO--last in, | Line 1778 in which they were saved (LIFO--last in, |
1778 | ||
1779 | File: m4.info, Node: File Inclusion, Next: Diversions, Prev: Input Control, Up: Top | File: m4.info, Node: File Inclusion, Next: Diversions, Prev: Input Control, Up: Top |
1780 | ||
1781 | 8 File inclusion | File inclusion |
1782 | **************** | ************** |
1783 | ||
1784 | `m4' allows you to include named files at any point in the input. | `m4' allows you to include named files at any point in the input. |
1785 | ||
# | Line 1782 File: m4.info, Node: File Inclusion, N | Line 1791 File: m4.info, Node: File Inclusion, N |
1791 | ||
1792 | File: m4.info, Node: Include, Next: Search Path, Prev: File Inclusion, Up: File Inclusion | File: m4.info, Node: Include, Next: Search Path, Prev: File Inclusion, Up: File Inclusion |
1793 | ||
1794 | 8.1 Including named files | Including named files |
1795 | ========================= | ===================== |
1796 | ||
1797 | There are two builtin macros in `m4' for including files: | There are two builtin macros in `m4' for including files: |
1798 | ||
# | Line 1811 include a file, if it exists, expanding | Line 1820 include a file, if it exists, expanding |
1820 | Include file start | Include file start |
1821 | foo | foo |
1822 | Include file end | Include file end |
1823 | Normally file inclusion is used to insert the contents of a file | |
1824 | into the input stream. The contents of the file will be read by `m4' | Normally file inclusion is used to insert the contents of a file into |
1825 | and macro calls in the file will be expanded: | the input stream. The contents of the file will be read by `m4' and |
1826 | macro calls in the file will be expanded: | |
1827 | ||
1828 | define(`foo', `FOO') | define(`foo', `FOO') |
1829 | => | => |
# | Line 1846 given arguments. | Line 1856 given arguments. |
1856 | ||
1857 | File: m4.info, Node: Search Path, Prev: Include, Up: File Inclusion | File: m4.info, Node: Search Path, Prev: Include, Up: File Inclusion |
1858 | ||
1859 | 8.2 Searching for include files | Searching for include files |
1860 | =============================== | =========================== |
1861 | ||
1862 | GNU `m4' allows included files to be found in other directories than | GNU `m4' allows included files to be found in other directories than |
1863 | the current working directory. | the current working directory. |
# | Line 1865 debug flag (*note Debug Levels::) can he | Line 1875 debug flag (*note Debug Levels::) can he |
1875 | ||
1876 | File: m4.info, Node: Diversions, Next: Text handling, Prev: File Inclusion, Up: Top | File: m4.info, Node: Diversions, Next: Text handling, Prev: File Inclusion, Up: Top |
1877 | ||
1878 | 9 Diverting and undiverting output | Diverting and undiverting output |
1879 | ********************************** | ******************************** |
1880 | ||
1881 | Diversions are a way of temporarily saving output. The output of `m4' | Diversions are a way of temporarily saving output. The output of `m4' |
1882 | can at any time be diverted to a temporary file, and be reinserted into | can at any time be diverted to a temporary file, and be reinserted into |
# | Line 1893 number of available file descriptors. | Line 1903 number of available file descriptors. |
1903 | ||
1904 | File: m4.info, Node: Divert, Next: Undivert, Prev: Diversions, Up: Diversions | File: m4.info, Node: Divert, Next: Undivert, Prev: Diversions, Up: Diversions |
1905 | ||
1906 | 9.1 Diverting output | Diverting output |
1907 | ==================== | ================ |
1908 | ||
1909 | Output is diverted using `divert': | Output is diverted using `divert': |
1910 | ||
# | Line 1937 definitions. Here is how to avoid them. | Line 1947 definitions. Here is how to avoid them. |
1947 | ||
1948 | File: m4.info, Node: Undivert, Next: Divnum, Prev: Divert, Up: Diversions | File: m4.info, Node: Undivert, Next: Divnum, Prev: Divert, Up: Diversions |
1949 | ||
1950 | 9.2 Undiverting output | Undiverting output |
1951 | ====================== | ================== |
1952 | ||
1953 | Diverted text can be undiverted explicitly using the builtin `undivert': | Diverted text can be undiverted explicitly using the builtin `undivert': |
1954 | ||
# | Line 2005 contains the word `bar': | Line 2015 contains the word `bar': |
2015 | ||
2016 | File: m4.info, Node: Divnum, Next: Cleardiv, Prev: Undivert, Up: Diversions | File: m4.info, Node: Divnum, Next: Cleardiv, Prev: Undivert, Up: Diversions |
2017 | ||
2018 | 9.3 Diversion numbers | Diversion numbers |
2019 | ===================== | ================= |
2020 | ||
2021 | The builtin `divnum': | The builtin `divnum': |
2022 | ||
# | Line 2034 undiverted text would otherwise be diver | Line 2044 undiverted text would otherwise be diver |
2044 | ||
2045 | File: m4.info, Node: Cleardiv, Prev: Divnum, Up: Diversions | File: m4.info, Node: Cleardiv, Prev: Divnum, Up: Diversions |
2046 | ||
2047 | 9.4 Discarding diverted text | Discarding diverted text |
2048 | ============================ | ======================== |
2049 | ||
2050 | Often it is not known, when output is diverted, whether the diverted | Often it is not known, when output is diverted, whether the diverted |
2051 | text is actually needed. Since all non-empty diversion are brought back | text is actually needed. Since all non-empty diversion are brought back |
# | Line 2067 should try to see if you can find it and | Line 2077 should try to see if you can find it and |
2077 | ||
2078 | File: m4.info, Node: Text handling, Next: Arithmetic, Prev: Diversions, Up: Top | File: m4.info, Node: Text handling, Next: Arithmetic, Prev: Diversions, Up: Top |
2079 | ||
2080 | 10 Macros for text handling | Macros for text handling |
2081 | *************************** | ************************ |
2082 | ||
2083 | There are a number of builtins in `m4' for manipulating text in various | There are a number of builtins in `m4' for manipulating text in various |
2084 | ways, extracting substrings, searching, substituting, and so on. | ways, extracting substrings, searching, substituting, and so on. |
# | Line 2086 ways, extracting substrings, searching, | Line 2096 ways, extracting substrings, searching, |
2096 | ||
2097 | File: m4.info, Node: Len, Next: Index, Prev: Text handling, Up: Text handling | File: m4.info, Node: Len, Next: Index, Prev: Text handling, Up: Text handling |
2098 | ||
2099 | 10.1 Calculating length of strings | Calculating length of strings |
2100 | ================================== | ============================= |
2101 | ||
2102 | The length of a string can be calculated by `len': | The length of a string can be calculated by `len': |
2103 | ||
# | Line 2105 which expands to the length of STRING, a | Line 2115 which expands to the length of STRING, a |
2115 | ||
2116 | File: m4.info, Node: Index, Next: Regexp, Prev: Len, Up: Text handling | File: m4.info, Node: Index, Next: Regexp, Prev: Len, Up: Text handling |
2117 | ||
2118 | 10.2 Searching for substrings | Searching for substrings |
2119 | ============================= | ======================== |
2120 | ||
2121 | Searching for substrings is done with `index': | Searching for substrings is done with `index': |
2122 | ||
# | Line 2126 not occur in STRING, `index' expands to | Line 2136 not occur in STRING, `index' expands to |
2136 | ||
2137 | File: m4.info, Node: Regexp, Next: Substr, Prev: Index, Up: Text handling | File: m4.info, Node: Regexp, Next: Substr, Prev: Index, Up: Text handling |
2138 | ||
2139 | 10.3 Searching for regular expressions | Searching for regular expressions |
2140 | ====================================== | ================================= |
2141 | ||
2142 | Searching for regular expressions is done with the builtin `regexp': | Searching for regular expressions is done with the builtin `regexp': |
2143 | ||
# | Line 2159 regular expression matched. | Line 2169 regular expression matched. |
2169 | ||
2170 | File: m4.info, Node: Substr, Next: Translit, Prev: Regexp, Up: Text handling | File: m4.info, Node: Substr, Next: Translit, Prev: Regexp, Up: Text handling |
2171 | ||
2172 | 10.4 Extracting substrings | Extracting substrings |
2173 | ========================== | ===================== |
2174 | ||
2175 | Substrings are extracted with `substr': | Substrings are extracted with `substr': |
2176 | ||
# | Line 2180 is omitted. The starting index of a str | Line 2190 is omitted. The starting index of a str |
2190 | ||
2191 | File: m4.info, Node: Translit, Next: Patsubst, Prev: Substr, Up: Text handling | File: m4.info, Node: Translit, Next: Patsubst, Prev: Substr, Up: Text handling |
2192 | ||
2193 | 10.5 Translating characters | Translating characters |
2194 | =========================== | ====================== |
2195 | ||
2196 | Character translation is done with `translit': | Character translation is done with `translit': |
2197 | ||
# | Line 2219 most common. | Line 2229 most common. |
2229 | ||
2230 | File: m4.info, Node: Patsubst, Next: Format, Prev: Translit, Up: Text handling | File: m4.info, Node: Patsubst, Next: Format, Prev: Translit, Up: Text handling |
2231 | ||
2232 | 10.6 Substituting text by regular expression | Substituting text by regular expression |
2233 | ============================================ | ======================================= |
2234 | ||
2235 | Global substitution in a string is done by `patsubst': | Global substitution in a string is done by `patsubst': |
2236 | ||
2237 | patsubst(STRING, REGEXP, opt REPLACEMENT) | patsubst(STRING, REGEXP, opt REPLACEMENT) |
2238 | which searches STRING for matches of REGEXP, and substitutes | |
2239 | which searches STRING for matches of REGEXP, and substitutes | |
2240 | REPLACEMENT for each match. The syntax for regular expressions is the | REPLACEMENT for each match. The syntax for regular expressions is the |
2241 | same as in GNU Emacs. | same as in GNU Emacs. |
2242 | ||
# | Line 2273 individual word or whole sentences, by s | Line 2284 individual word or whole sentences, by s |
2284 | ||
2285 | File: m4.info, Node: Format, Prev: Patsubst, Up: Text handling | File: m4.info, Node: Format, Prev: Patsubst, Up: Text handling |
2286 | ||
2287 | 10.7 Formatted output | Formatted output |
2288 | ===================== | ================ |
2289 | ||
2290 | Formatted output can be made with `format': | Formatted output can be made with `format': |
2291 | ||
# | Line 2316 the functioning of `printf', see the C L | Line 2327 the functioning of `printf', see the C L |
2327 | ||
2328 | File: m4.info, Node: Arithmetic, Next: UNIX commands, Prev: Text handling, Up: Top | File: m4.info, Node: Arithmetic, Next: UNIX commands, Prev: Text handling, Up: Top |
2329 | ||
2330 | 11 Macros for doing arithmetic | Macros for doing arithmetic |
2331 | ****************************** | *************************** |
2332 | ||
2333 | Integer arithmetic is included in `m4', with a C-like syntax. As | Integer arithmetic is included in `m4', with a C-like syntax. As |
2334 | convenient shorthands, there are builtins for simple increment and | convenient shorthands, there are builtins for simple increment and |
# | Line 2331 decrement operations. | Line 2342 decrement operations. |
2342 | ||
2343 | File: m4.info, Node: Incr, Next: Eval, Prev: Arithmetic, Up: Arithmetic | File: m4.info, Node: Incr, Next: Eval, Prev: Arithmetic, Up: Arithmetic |
2344 | ||
2345 | 11.1 Decrement and increment operators | Decrement and increment operators |
2346 | ====================================== | ================================= |
2347 | ||
2348 | Increment and decrement of integers are supported using the builtins | Increment and decrement of integers are supported using the builtins |
2349 | `incr' and `decr': | `incr' and `decr': |
# | Line 2354 arguments. | Line 2365 arguments. |
2365 | ||
2366 | File: m4.info, Node: Eval, Prev: Incr, Up: Arithmetic | File: m4.info, Node: Eval, Prev: Incr, Up: Arithmetic |
2367 | ||
2368 | 11.2 Evaluating integer expressions | Evaluating integer expressions |
2369 | =================================== | ============================== |
2370 | ||
2371 | Integer expressions are evaluated with `eval': | Integer expressions are evaluated with `eval': |
2372 | ||
# | Line 2475 requested width. | Line 2486 requested width. |
2486 | ||
2487 | File: m4.info, Node: UNIX commands, Next: Miscellaneous, Prev: Arithmetic, Up: Top | File: m4.info, Node: UNIX commands, Next: Miscellaneous, Prev: Arithmetic, Up: Top |
2488 | ||
2489 | 12 Running UNIX commands | Running UNIX commands |
2490 | ************************ | ********************* |
2491 | ||
2492 | There are a few builtin macros in `m4' that allow you to run UNIX | There are a few builtin macros in `m4' that allow you to run UNIX |
2493 | commands from within `m4'. | commands from within `m4'. |
# | Line 2491 commands from within `m4'. | Line 2502 commands from within `m4'. |
2502 | ||
2503 | File: m4.info, Node: Syscmd, Next: Esyscmd, Prev: UNIX commands, Up: UNIX commands | File: m4.info, Node: Syscmd, Next: Esyscmd, Prev: UNIX commands, Up: UNIX commands |
2504 | ||
2505 | 12.1 Executing simple commands | Executing simple commands |
2506 | ============================== | ========================= |
2507 | ||
2508 | Any shell command can be executed, using `syscmd': | Any shell command can be executed, using `syscmd': |
2509 | ||
# | Line 2514 same as those of `m4'. | Line 2525 same as those of `m4'. |
2525 | ||
2526 | File: m4.info, Node: Esyscmd, Next: Sysval, Prev: Syscmd, Up: UNIX commands | File: m4.info, Node: Esyscmd, Next: Sysval, Prev: Syscmd, Up: UNIX commands |
2527 | ||
2528 | 12.2 Reading the output of commands | Reading the output of commands |
2529 | =================================== | ============================== |
2530 | ||
2531 | If you want `m4' to read the output of a UNIX command, use `esyscmd': | If you want `m4' to read the output of a UNIX command, use `esyscmd': |
2532 | ||
# | Line 2544 distribution, then: | Line 2555 distribution, then: |
2555 | ||
2556 | File: m4.info, Node: Sysval, Next: Maketemp, Prev: Esyscmd, Up: UNIX commands | File: m4.info, Node: Sysval, Next: Maketemp, Prev: Esyscmd, Up: UNIX commands |
2557 | ||
2558 | 12.3 Exit codes | Exit codes |
2559 | =============== | ========== |
2560 | ||
2561 | To see whether a shell command succeeded, use `sysval': | To see whether a shell command succeeded, use `sysval': |
2562 | ||
# | Line 2566 which expands to the exit status of the | Line 2577 which expands to the exit status of the |
2577 | ||
2578 | File: m4.info, Node: Maketemp, Prev: Sysval, Up: UNIX commands | File: m4.info, Node: Maketemp, Prev: Sysval, Up: UNIX commands |
2579 | ||
2580 | 12.4 Making names for temporary files | Making names for temporary files |
2581 | ===================================== | ================================ |
2582 | ||
2583 | Commands specified to `syscmd' or `esyscmd' might need a temporary | Commands specified to `syscmd' or `esyscmd' might need a temporary |
2584 | file, for output or for some other purpose. There is a builtin macro, | file, for output or for some other purpose. There is a builtin macro, |
# | Line 2588 the `m4' process, in order to make the f | Line 2599 the `m4' process, in order to make the f |
2599 | ||
2600 | File: m4.info, Node: Miscellaneous, Next: Frozen files, Prev: UNIX commands, Up: Top | File: m4.info, Node: Miscellaneous, Next: Frozen files, Prev: UNIX commands, Up: Top |
2601 | ||
2602 | 13 Miscellaneous builtin macros | Miscellaneous builtin macros |
2603 | ******************************* | **************************** |
2604 | ||
2605 | This chapter describes various builtins, that do not really belong in | This chapter describes various builtins, that do not really belong in |
2606 | any of the previous chapters. | any of the previous chapters. |
# | Line 2602 any of the previous chapters. | Line 2613 any of the previous chapters. |
2613 | ||
2614 | File: m4.info, Node: Errprint, Next: M4exit, Prev: Miscellaneous, Up: Miscellaneous | File: m4.info, Node: Errprint, Next: M4exit, Prev: Miscellaneous, Up: Miscellaneous |
2615 | ||
2616 | 13.1 Printing error messages | Printing error messages |
2617 | ============================ | ======================= |
2618 | ||
2619 | You can print error messages using `errprint': | You can print error messages using `errprint': |
2620 | ||
2621 | errprint(MESSAGE, ...) | errprint(MESSAGE, ...) |
2622 | which simply prints MESSAGE and the rest of the arguments on the | |
2623 | which simply prints MESSAGE and the rest of the arguments on the | |
2624 | standard error output. | standard error output. |
2625 | ||
2626 | The expansion of `errprint' is void. | The expansion of `errprint' is void. |
# | Line 2627 utility builtins exist: | Line 2639 utility builtins exist: |
2639 | ||
2640 | __file__ | __file__ |
2641 | __line__ | __line__ |
2642 | which expands to the quoted name of the current input file, and the | |
2643 | which expands to the quoted name of the current input file, and the | |
2644 | current input line number in that file. | current input line number in that file. |
2645 | ||
2646 | errprint(`m4:'__file__:__line__: `Input error | errprint(`m4:'__file__:__line__: `Input error |
# | Line 2638 current input line number in that file. | Line 2651 current input line number in that file. |
2651 | ||
2652 | File: m4.info, Node: M4exit, Prev: Errprint, Up: Miscellaneous | File: m4.info, Node: M4exit, Prev: Errprint, Up: Miscellaneous |
2653 | ||
2654 | 13.2 Exiting from `m4' | Exiting from `m4' |
2655 | ====================== | ================= |
2656 | ||
2657 | If you need to exit from `m4' before the entire input has been read, | If you need to exit from `m4' before the entire input has been read, |
2658 | you can use `m4exit': | you can use `m4exit': |
2659 | ||
2660 | m4exit(opt CODE) | m4exit(opt CODE) |
2661 | which causes `m4' to exit, with exit code CODE. If CODE is left | |
2662 | out, the exit code is zero. | which causes `m4' to exit, with exit code CODE. If CODE is left out, |
2663 | the exit code is zero. | |
2664 | ||
2665 | define(`fatal_error', `errprint(`m4: '__file__: __line__`: fatal error: $* | define(`fatal_error', `errprint(`m4: '__file__: __line__`: fatal error: $* |
2666 | ')m4exit(1)') | ')m4exit(1)') |
# | Line 2662 not followed, e.g., diverted text is not | Line 2676 not followed, e.g., diverted text is not |
2676 | ||
2677 | File: m4.info, Node: Frozen files, Next: Compatibility, Prev: Miscellaneous, Up: Top | File: m4.info, Node: Frozen files, Next: Compatibility, Prev: Miscellaneous, Up: Top |
2678 | ||
2679 | 14 Fast loading of frozen states | Fast loading of frozen states |
2680 | ******************************** | ***************************** |
2681 | ||
2682 | Some bigger `m4' applications may be built over a common base | Some bigger `m4' applications may be built over a common base |
2683 | containing hundreds of definitions and other costly initializations. | containing hundreds of definitions and other costly initializations. |
# | Line 2777 decimal. The directives are: | Line 2791 decimal. The directives are: |
2791 | ||
2792 | File: m4.info, Node: Compatibility, Next: Concept index, Prev: Frozen files, Up: Top | File: m4.info, Node: Compatibility, Next: Concept index, Prev: Frozen files, Up: Top |
2793 | ||
2794 | 15 Compatibility with other versions of `m4' | Compatibility with other versions of `m4' |
2795 | ******************************************** | ***************************************** |
2796 | ||
2797 | This chapter describes the differences between this implementation of | This chapter describes the differences between this implementation of |
2798 | `m4', and the implementation found under UNIX, notably System V, | `m4', and the implementation found under UNIX, notably System V, |
# | Line 2796 made to summarize these here. | Line 2810 made to summarize these here. |
2810 | ||
2811 | File: m4.info, Node: Extensions, Next: Incompatibilities, Prev: Compatibility, Up: Compatibility | File: m4.info, Node: Extensions, Next: Incompatibilities, Prev: Compatibility, Up: Compatibility |
2812 | ||
2813 | 15.1 Extensions in GNU `m4' | Extensions in GNU `m4' |
2814 | =========================== | ====================== |
2815 | ||
2816 | This version of `m4' contains a few facilities, that do not exist in | This version of `m4' contains a few facilities, that do not exist in |
2817 | System V `m4'. These extra facilities are all suppressed by using the | System V `m4'. These extra facilities are all suppressed by using the |
# | Line 2854 extensive than in most other versions of | Line 2868 extensive than in most other versions of |
2868 | ||
2869 | File: m4.info, Node: Incompatibilities, Next: Other Incompat, Prev: Extensions, Up: Compatibility | File: m4.info, Node: Incompatibilities, Next: Other Incompat, Prev: Extensions, Up: Compatibility |
2870 | ||
2871 | 15.2 Facilities in System V `m4' not in GNU `m4' | Facilities in System V `m4' not in GNU `m4' |
2872 | ================================================ | =========================================== |
2873 | ||
2874 | The version of `m4' from System V contains a few facilities that have | The version of `m4' from System V contains a few facilities that have |
2875 | not been implemented in GNU `m4' yet. | not been implemented in GNU `m4' yet. |
# | Line 2866 not been implemented in GNU `m4' yet. | Line 2880 not been implemented in GNU `m4' yet. |
2880 | ||
2881 | File: m4.info, Node: Other Incompat, Prev: Incompatibilities, Up: Compatibility | File: m4.info, Node: Other Incompat, Prev: Incompatibilities, Up: Compatibility |
2882 | ||
2883 | 15.3 Other incompatibilities | Other incompatibilities |
2884 | ============================ | ======================= |
2885 | ||
2886 | There are a few other incompatibilities between this implementation of | There are a few other incompatibilities between this implementation of |
2887 | `m4', and the System V version. | `m4', and the System V version. |
# | Line 2920 File: m4.info, Node: Concept index, Ne | Line 2934 File: m4.info, Node: Concept index, Ne |
2934 | Concept index | Concept index |
2935 | ************* | ************* |
2936 | ||