Re: [groff] Changing A Defined String

2018-01-27 Thread Steffen Nurpmeso
Tadziu Hoffmann wrote: |> Why this? If i use \\*[DATE*SHORT] anything is fine, so it is |> because the macro is evaluated while the string is defined. | |Yes. | |If you use the "string" like this: | | Some text before \*[DATE*SHORT], and some text after | |the expansion will yield |

Re: [groff] Changing A Defined String

2018-01-27 Thread Tadziu Hoffmann
> Why this? If i use \\*[DATE*SHORT] anything is fine, so it is > because the macro is evaluated while the string is defined. Yes. If you use the "string" like this: Some text before \*[DATE*SHORT], and some text after the expansion will yield Some text before \c .XX \\*[DATE*FULL] ,

Re: [groff] Changing A Defined String

2018-01-27 Thread Steffen Nurpmeso
Tadziu Hoffmann wrote: |Just a short addendum: | |Since you know that you'll only be stripping off one of the |known weekday names, there's also a simpler solution: ... |However, there is still a caveat with these solutions: although |\*[DATE*SHORT] may look like a (single-line) string exp

Re: [groff] Changing A Defined String

2018-01-27 Thread Tadziu Hoffmann
> But I don't think that eliminates the macro call stack > growing on tail recursion, like dc(1) does for example? True, groff does not have an optimization for tail recursion, so the input stack will fill up even in this case. > I see groff's info says «Note that the number of available > recur

Re: [groff] Changing A Defined String

2018-01-27 Thread Tadziu Hoffmann
Just a short addendum: Since you know that you'll only be stripping off one of the known weekday names, there's also a simpler solution: .\" .de DATE*SHORT \c .XX \\*[DATE*FULL] .. .de XX .ds BB \\$* .ds AA \\$1 .

Re: [groff] Changing A Defined String

2018-01-27 Thread Ralph Corderoy
Hi Tadziu, > > > Or there's a `.while' IIRC. :-) > > The ".while" construct isn't strictly necessary, because the roff > language supports recursion. 8-) True! But I don't think that eliminates the macro call stack growing on tail recursion, like dc(1) does for example? I see groff's info say