groff
[Top][All Lists]
Advanced

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

Re: [Groff] Question about .substring


From: Ralph Corderoy
Subject: Re: [Groff] Question about .substring
Date: Sat, 29 Nov 2014 18:12:53 +0000

Hi Steffen,

>  |I think his point is[.]
> 
> No, it works fine in practice:

My snipped point still stands though, you can't use .substring to get a
zero-length string from a non-empty one.

    > > > The current behaviour is an unusable mystery to me personally:
    > > > how can you gain a substring of length null, for example, and
    > > > without introducing lengthy calculations on macro level?
    ...
    > I think his point is given string s of `abcdefghij', one wants the
    > substring starting at index 2, `c', of length 0, 1, or 2.  `2 2'
    > gives `c', `2 3' `cd'.  `2 1' is swapped to `1 2' giving `bc'.
    > There's no second parameter that gives an empty string

It's just you didn't need to do that in your clean-up macro.  :-)

> It was generated with this piece of code:
> 
>   . \" TODO doc-mx-cleanup-string: replace with .stringof, if d
>   .de doc-mx-cleanup-string
>   .tm1 CLEAN UP <\$1>

It seems odd that this and the rest of the macro doesn't need two
backslashes, e.g. `<\\$1>'.

Cheers, Ralph.



reply via email to

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