Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!bbn!bbn.com!cosell From: cosell@bbn.com (Bernie Cosell) Newsgroups: comp.text Subject: Re: Explain Use of s in Macros Keywords: troff macros Message-ID: <50451@bbn.COM> Date: 5 Jan 90 03:40:30 GMT References: <140@altos86.Altos.COM> Sender: news@bbn.COM Lines: 20 charly@altos86.Altos.COM (Charly Rhoades) writes: }I'm hacking troff code, and I come across a number of constructions }that use characters, such as the examples below: Dunno about the first two, but this one: } .if^G\\$1^G2^G .if !^G\\$5^G^G .ds }i\^ is pretty standard usage. The problem is that this part of troff uses character delimited strings. So in order to work, you have to guarantee that the delimiter doesn't appear *in* the strings themselves. Now, this is mostly trivial when you are delmiting your own strings, but it becomes a bit problematic when you're writing a macro that is going to take a string from \\$1. What you have to do is pick an unlikely character to use as the in-the-macro delimiter. We used '~' for a while, and while it was readable it really wasn't acceptable. control-G is a fairly conventional char to use for that purpose. /Bernie\