Re: [Groff] Divert into string variable

2014-11-29 Thread Carsten Kunze
> > Yes. But does this say that the diverted data can be accessed via \*(xx? > > It shouldn't be done. Whether it *can* be done is an implementation > detail. In many languages you can create interesting effects by > writing to an array with an out-of-bounds index. That doesn't mean > it *shou

Re: [Groff] Divert into string variable

2014-11-29 Thread Tadziu Hoffmann
> Yes. But does this say that the diverted data can be accessed via \*(xx? It shouldn't be done. Whether it *can* be done is an implementation detail. In many languages you can create interesting effects by writing to an array with an out-of-bounds index. That doesn't mean it *should* be done

Re: [Groff] Divert into string variable

2014-11-29 Thread Carsten Kunze
Hi Ralph, > Disagree. The venerable CSTR 54. > > 7.1. ... Request, macro, and string names share the same name > list. Yes, ok. But I had stated that it is not specified in CSTR54 that macro contents can be accessed via \*(xx and that a string defined with ".ds xx ..." can be acces

Re: [Groff] Divert into string variable

2014-11-29 Thread Ralph Corderoy
Hi Carsten, > But can it be agreed, that it's not specified for historical troff? Disagree. The venerable CSTR 54. 7.1. ... Request, macro, and string names share the same name list. 7.4. Diversions. Processed output may be diverted into a macro for purposes... So it's not

Re: [Groff] Divert into string variable

2014-11-29 Thread Carsten Kunze
> It's documented in the groff manual in section 5.19; see the sentence > "Strings, macros, and diversions (and boxes) share the same name > space" and the following few paragraphs. Didn't read it to the end--yes, the following sentences do. But can it be agreed, that it's not specified for hist

Re: [Groff] Divert into string variable

2014-11-29 Thread Carsten Kunze
Dave Kemper wrote: > It's documented in the groff manual in section 5.19; see the sentence > "Strings, macros, and diversions (and boxes) share the same name > space" and the following few paragraphs. That doesn't describe it. But indeed the following sentences (of the groff manual) do. But i

Re: [Groff] Divert into string variable

2014-11-28 Thread Werner LEMBERG
>> This usage is IMHO not documented in the troff manual § 7.4 or >> groff manual § 5.25. > > It's documented in the groff manual in section 5.19; see the > sentence "Strings, macros, and diversions (and boxes) share the same > name space" and the following few paragraphs. ... and please look up

Re: [Groff] Divert into string variable

2014-11-28 Thread Dave Kemper
On 11/28/14, Carsten Kunze wrote: > This usage is IMHO not documented in the troff manual § 7.4 or groff manual § > 5.25. It's documented in the groff manual in section 5.19; see the sentence "Strings, macros, and diversions (and boxes) share the same name space" and the following few paragraphs

Re: [Groff] Divert into string variable

2014-11-28 Thread Tadziu Hoffmann
> is it safe to divert into a string variable? In a way, roff doesn't really distinguish between "strings", "macros", and "diversions". They all share the same namespace and can be accessed both via ".xx" at the beginning of an input line and as "\*[xx]". The results, however, will depend on wh

[Groff] Divert into string variable

2014-11-28 Thread Carsten Kunze
Hello, is it safe to divert into a string variable? That means instead of: .br .di A ...text... .br .di .A use something like: .br .di A ...text... .br .di ...\*A... The 4.4BSD mdoc macros use this in the macro .x2. The string is even interpolated in fill mode there... It works somehow but