groff
[Top][All Lists]
Advanced

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

Re: [Groff] \$[m-n] \$[m-] \$[-n]


From: Denis M. Wilson
Subject: Re: [Groff] \$[m-n] \$[m-] \$[-n]
Date: Fri, 6 May 2011 14:20:28 +0100

This would be feature bloat, as there are ways to do all this
already.

On Tue, 3
May 2011 13:17:27 -0700 (PDT) Dorai Sitaram <address@hidden> wrote:

> Wouldn't it be useful to have parameters like \$[m-n] that pick out
> the parameters \$m through \$n ?

Try writing a simple macro (eg)

.params m n $@

where m or n can be -.

> 
> Right now, a macro's body can use \$1 ... \$n, and \$*, and \$@, and
> then call .shift howsoever many times to get the right "slice".

> However, a similar ability isn't available for string definitions
> (with .ds).   \$[m-n] (and perhaps also \$[m-] and \$[-n] where one
> end of the range is not specified) would ameliorate this lack.

For strings try using the .substring command.

Denis



reply via email to

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