Mike Bianchi schrieb: > On Thu, Feb 04, 2010 at 10:11:59PM +0100, Werner LEMBERG wrote: >>> No macro, register, or string name within standard macro >>> packages will ever end in * . Thus all user created names >>> that end in * will never collide with any within the standard >>> macro packages. >> Nice idea. Have you already verified that no macro provided by any of >> the `big' macro packages end with `*'? > > No, I have not. I was just shooting from the hip. > >> It should be noted that such >> user macro names must be longer than two characters. > > > I'm thinking groff needs the concept of namespace . > > By default, everything lives in the top, unnamed namespace so all the bugs > are preserved. > > E.g. > .de LI \" my own take on the LI macro in the mm macros > : > .. > > .namespace MM -mm \" start the namespace MM, > \" which contains the -mm macro package. > > .MM.BL \" use .BL from the MM namespace > .LI \" use .LI from the top (unnamed) namespace > : > .MM.LI \" use .LI from MM > : > .MM.LE > > .BL \" There is only one .BL (in MM); use it. > .LI \" As above. > : > .MM.LI \" As above. > : > .LE \" There is only one .LE (in MM); use it. > > .MM. \" default all following macros to the MM namespace. > .BL \" use .BL from MM > .LI \" use .LI from MM > : > ._.LI \" use .LI from the unnamed namespace (named _ ?) > : > .LE > ..namespace MM \" end default to MM . > > .MM.BL \" still defined. > > .namespace Mine \" start the Mine namespace. > .de Glurp \" defines .Mine.Glurp . > : > .. > .Glurp \" uses .Mine.Glurp , > \"" unless ._.Glurp is defined. > ..namespace Mine \" end Mine . > > .Mine.Glurp \" still defined. > > This is just a sketch, and needs to be thought about more. > I'm sure someone who designs languages will have good suggestions. >
1. I have no idea about the inner workings of groff/troff. I do not thing that there is a need for namespaces. Simply stop when a macro is defined again (opposed to redefined), helpful error messages will support debugging. re, wh