🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.text
Article #586

Re: !'\\$1'' vs. \w'\\$1' in TROFF

#586
From: Henry Spencer
Date: Wed, 16 Aug 1989 15:54
14 lines
955 bytes
In article <2658@aplcen.apl.jhu.edu> bink@aplcen.apl.jhu.edu (Ubben Greg) writes:
>What are the advantages and disadvantages of using
>	.if \w'\\$1' ...
>instead of
>	.if !'\\$1'' ...
>in DWB 2.0 DiTroff macros? ...

They're two different things.  The first asks if the width of the string
is non-zero.  The second asks whether there are any characters in it.
Remember that there are such things as zero-width characters.  People who
use the first form to test for an empty string have goofed.
-- 
V7 /bin/mail source: 554 lines.|     Henry Spencer at U of Toronto Zoology
1989 X.400 specs: 2200+ pages. | uunet!attcan!utzoo!henry henry@zoo.toronto.edu
Technical Details
Message-ID: <1989Aug16.155455.20836@utzoo.uucp>
Path: arc1-ca.pugleaf.net!utzoo!henry
References: <2658@aplcen.apl.jhu.edu>

Show Full Headers
Complete Article Headers
Newsgroups: comp.text
Path: arc1-ca.pugleaf.net!utzoo!henry
From: henry@utzoo.uucp (Henry Spencer)
Subject: Re: !'\\$1'' vs. \w'\\$1' in TROFF
Message-ID: <1989Aug16.155455.20836@utzoo.uucp>
Organization: U of Toronto Zoology
References: <2658@aplcen.apl.jhu.edu>
Date: Wed, 16 Aug 89 15:54:55 GMT