diff options
author | wl <wl> | 2010-07-28 16:53:33 +0000 |
---|---|---|
committer | wl <wl> | 2010-07-28 16:53:33 +0000 |
commit | 819deb8e912543224eb32c7545ba0d1ff047fd3d (patch) | |
tree | 8bb78ddd7db7e88607c8826d26fa4646669a776a | |
parent | eac6e14e1daa6732c58525896ee182be4387bb95 (diff) | |
download | groff-819deb8e912543224eb32c7545ba0d1ff047fd3d.tar.gz |
* doc/groff.texinfo, man/groff.man: Document `!' operator better.
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | doc/groff.texinfo | 26 | ||||
-rw-r--r-- | man/groff.man | 12 |
3 files changed, 40 insertions, 2 deletions
@@ -1,3 +1,7 @@ +2010-07-28 Larry Kollar <kollar@windstream.net> + + * doc/groff.texinfo, man/groff.man: Document `!' operator better. + 2010-06-28 Jan Vcelak <jvcelak@redhat.com> * src/roff/troff/node.cpp (make_node): Adding missing `%'. diff --git a/doc/groff.texinfo b/doc/groff.texinfo index acd86c4d..ae2ac6ea 100644 --- a/doc/groff.texinfo +++ b/doc/groff.texinfo @@ -5128,6 +5128,32 @@ requests).@footnote{Note that, for example, @samp{!(-1)} evaluates to `true' because @code{gtroff} treats both negative numbers and zero as `false'.} See below for the use of unary operators in motion requests. +@cindex logical not, limitation in expression +@cindex expression, limitation of logical not in +The logical not operator, +as described above, +works only within @code{if} and @code{while} requests. +Furthermore, it may appear +only at the beginning of an expression, +and negates the entire expression. +Attempting to insert the @samp{!} operator +within the expression results in a +@samp{numeric expression expected} warning. This +maintains bug-compatibility +with old versions of @code{troff}. + +Example: + +@Example +.nr X 1 +.nr Y 0 +.\" This does not work as expected +.if (\n[X])&(!\n[Y]) .nop X only +. +.\" Use this construct instead +.if (\n[X]=1)&(\n[Y]=0) .nop X only +@endExample + @item @cindex extremum operators (@code{>?}, @code{<?}) @cindex operators, extremum (@code{>?}, @code{<?}) diff --git a/man/groff.man b/man/groff.man index 35c0bd9c..c89dcfdd 100644 --- a/man/groff.man +++ b/man/groff.man @@ -884,7 +884,7 @@ yields true if its value is greater than\~0. .BI ! N True if the value of .I I -is\~0. +is\~0 (see below). . .TPx .BI \[aq] s1 \[aq] s2 \[aq] @@ -898,7 +898,8 @@ is identical to string\~\c True if string\~\c .I s1 is not identical to string\~\c -.IR s2 . +.I s2 +(see below). . .TPx .BI c ch @@ -952,6 +953,13 @@ has been registered. . .RE .PD +.P +Note that the +.B ! +operator may only appear at the beginning of an expression, +and negates the entire expression. +This maintains bug-compatibility with AT&T +.IR troff . . . .\" -------------------------------------------------------------------- |