m4-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Changes to m4/doc/m4.texinfo,v [branch-1_4]


From: Eric Blake
Subject: Changes to m4/doc/m4.texinfo,v [branch-1_4]
Date: Fri, 16 Jun 2006 03:09:15 +0000

CVSROOT:        /sources/m4
Module name:    m4
Branch:         branch-1_4
Changes by:     Eric Blake <ericb>      06/06/16 03:09:14

Index: doc/m4.texinfo
===================================================================
RCS file: /sources/m4/m4/doc/m4.texinfo,v
retrieving revision 1.1.1.1.2.19
retrieving revision 1.1.1.1.2.20
diff -u -b -r1.1.1.1.2.19 -r1.1.1.1.2.20
--- doc/m4.texinfo      6 Jun 2006 13:20:57 -0000       1.1.1.1.2.19
+++ doc/m4.texinfo      16 Jun 2006 03:09:14 -0000      1.1.1.1.2.20
@@ -3501,7 +3501,9 @@
 @itemize @bullet
 @item
 System V @code{m4} supports multiple arguments to @code{defn}, and
address@hidden requires it.  This is not implemented in GNU @code{m4}.
address@hidden requires it.  This is not yet implemented in GNU
address@hidden  Unfortunately, this means it is not possible to mix builtins
+and other text into a single macro; a helper macro is required.
 
 @item
 @acronym{POSIX} requires an application to exit with non-zero status if
@@ -3518,11 +3520,34 @@
 
 @item
 @acronym{POSIX} requires @code{m4wrap} (@pxref{M4wrap}) to act in FIFO
-(first-in, first-out) order, but GNU @code{m4} uses LIFO order.
+(first-in, first-out) order, but GNU @code{m4} currently uses LIFO order.
 Furthermore, @acronym{POSIX} states that only the first argument to
 @code{m4wrap} is saved for later evaluation, bug GNU @code{m4} saves and
 processes all arguments, with output separated by spaces.
 
+However, it is possible to emulate @acronym{POSIX} behavior by
+including the sample file @file{wrapfifo.m4}:
+
address@hidden
+undivert(`wrapfifo.m4')dnl
address@hidden(`_m4wrap_level', `0')dnl
address@hidden(`m4wrap',
address@hidden(`m4wrap'_m4wrap_level,
address@hidden       `define(`m4wrap'_m4wrap_level,
address@hidden               defn(`m4wrap'_m4wrap_level)`$1')',
address@hidden       `builtin(`m4wrap', `define(`_m4wrap_level',
address@hidden                                  incr(_m4wrap_level))dnl
address@hidden'_m4wrap_level)dnl
address@hidden(`m4wrap'_m4wrap_level, `$1')')')dnl
+include(`wrapfifo.m4')
address@hidden
+m4wrap(`a`'m4wrap(`c
+', `d')')m4wrap(`b')
address@hidden
+^D
address@hidden
address@hidden example
+
 @item
 @acronym{POSIX} requires that all builtins that require arguments, but
 are called without arguments, behave as though empty strings had been
@@ -3531,11 +3556,11 @@
 arguments, giving @code{adefineb} for the above example.
 
 @item
-Traditional implementations treat @code{define(`f',1} (@pxref{Define})
-as though it were @code{undefine(`f')pushdef(`f',1)}, effectively
+Traditional implementations treat @code{define(`f',`1')} (@pxref{Define})
+as though it were @code{undefine(`f')pushdef(`f',`1')}, effectively
 replacing the entire stack of previously pushdef'd definitions with a
 single definition.  GNU @code{m4} behaves as
address@hidden(`f')pushdef(`f',1)}, keeping all previous definitions on
address@hidden(`f')pushdef(`f',`1')}, keeping all previous definitions on
 the stack intact.
 
 @item




reply via email to

[Prev in Thread] Current Thread [Next in Thread]