Hi Matthew,

from a user's point of view, your question finds an answer in the
language reference of groff.

$ man 7 groff

Search for "Identifiers". The last paragraph of this section says:
Identifiers for requests, macros, strings, and diversions share one
name  space;  special characters and character classes another.  No
other object types do.

The best thing you can do is design pseudo name spaces, e.g. by
prefixing your identifiers.

Maybe a groff wizard can disclose the existence secret local scopes, but
I am not sure.

Best regards,

Oliver.


On 15/10/2024 20:13, Matthew Polk wrote:
I'm currently getting impression that everything is global in groff, except 
maybe when talking about environment, then it's bound to that environment. But 
is anything assuming the environment doesn't change is local?

I ask because reading the heirloom-doctools manual, which is a very 
conservative implementation (Minus a couple of groff extensions implemented) of 
troff, states that the requests '.lds' and '.lnr' create a register such as a 
number or string bound to only the macro it was created in and erased when the 
macro has finished releasing the memory. But searching through the groff 
manual, I do not right now see anything like .lds or .lnr, so is there no 
intention behind such a thing? That environments is the only thing bounding a 
register even if introduced in a macro?

Maybe I'm thinking too much like a programming language such as C or Python 
where yes, there are very much such thing as a local variable. Is this why 
common groff naming convention has to name it a certain way to pretend its 
local?

I wasn't sure and wanted to know more about this. It would either through 
naming or actual local requests make things a bit easier.

--
Dr. Oliver Corff
mailto:oliver.co...@email.de


Reply via email to