groff
[Top][All Lists]
Advanced

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

Re: [groff] Changing A Defined String


From: Tadziu Hoffmann
Subject: Re: [groff] Changing A Defined String
Date: Sat, 27 Jan 2018 23:10:59 +0100
User-agent: Mutt/1.5.24 (2015-08-30)

> 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]
  , and some text after

and this in turn will eventually expand to

  Some text before \c
  December 31, 2038<no_newline>
  , and some text after

giving as the total effect

  Some text before \c
  December 31, 2038, and some text after

which is completely okay in running text.

When using it as

  .ds LH Formatted on \*[DATE*SHORT]

it will yield

  .ds LH Formatted on \c
  December 31, 2038

which simply stores "\c" in the string LH, and writes the
date into the running text instead.


> Is this restriction documented somewhere?  If not
> it is a bug to keep on the TODO list, thank you!

It's not a bug, it's a reminder not to use tricks that confuse
strings and macros, even if they are treated internally very
similarly during expansion.





reply via email to

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