Hi Branden,

On Thu Oct 30, 2025 at 12:15 AM CET, G. Branden Robinson wrote:
> At 2025-10-29T18:28:48+0100, Ingo Schwarze wrote:
> > G. Branden Robinson wrote on Wed, Oct 29, 2025 at 06:16:04AM -0500:
> > The real point why mandoc does not suffer from this former 
> > mdoc-macroset bug is that to distinguish callable macro names
> > from plain-text arguments, it does not use roff(7) registers (such
> > use being an internal implementation detail of mdoc macro sets
> > that is apparently prone to clashes),
>
> Yup.
>
> > but instead uses a separate hash table of macro names that cannot
> > clash with user-visible roff(7) language features.
>
> This is possible but harder to do in the *roff language itself
> (related: the performance misadventure of Savannah #67602). You
> have C at your disposal so the problem is more easily solved.

To be fair, it is just as easily solved in roff now that the 2-character
name limit is gone: just prefix the register names with something unique
to mdoc, e.g. mdoc-type-\$1 rather than \$1. The BSD macros obviously
couldn't do this because they were bound by the 2 character limit.

Cheers,
onf

Reply via email to