[Top][All Lists]

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

Re: [Groff] Question about .substring

From: Ingo Schwarze
Subject: Re: [Groff] Question about .substring
Date: Wed, 19 Nov 2014 18:20:45 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

Hi Steffen,

Steffen Nurpmeso wrote on Wed, Nov 19, 2014 at 06:09:08PM +0100:
> Ingo Schwarze <address@hidden> wrote:
>> Tadziu Hoffmann wrote on Wed, Nov 19, 2014 at 05:20:54PM +0100:

>>> Steffen Nurpmeso wrote:
>>> [snip]
>>> Where do you see a bug?
>>> man 7 groff:
>>>   .substring xx n1 n2
>>>     Replace the string named xx with the substring defined by
>>>     the indices n1 and n2.

>> The wording could be improved.  As it stands, it is not clear
>> whether the character at index n2 is the last character included
>> or the first character not included.
>> Maybe:
>>   Replace the string named xx with its substring beginning with
>>   the zero-based index n1 and ending with index n2, inclusively.

> Inclusive index n2 of the _resulting substring_, please.

I don't understand.  Neither what you think is wrong, nor how
you suggest to improve it.  It would help to show the complete
sentence you are proposing.

Note that "index n2" is not an index of the resulting substring,
but an index of the original string.

> For S-roff i will add a .substr request which takes an index and
> a length.  (Just like perl(1), if length is negative, "leaves that
> many characters off the end of the string".)

Please don't.  That is completely equivalent and trivial to convert
in either direction, so it merely bloats the user interface for no
gain whatsoever.  In case anybody ever starts using it (hopefully
not), you force every other implementation to follow, so everybody

While i like some aspects of Perl, lets not adopt the "there's
more than one way to do it" abomination into roff.  A concise,
consistent user interface is an asset.


reply via email to

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