groff
[Top][All Lists]
Advanced

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

[Groff] names in groff -- was: Another hdtbl patch


From: Mike Bianchi
Subject: [Groff] names in groff -- was: Another hdtbl patch
Date: Fri, 5 Feb 2010 09:58:19 -0500
User-agent: Mutt/1.5.17+20080114 (2008-01-14)

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.

Comments?

-- 
 Mike Bianchi
 Foveal Systems

 973 822-2085   call to arrange Fax

 address@hidden
 http://www.AutoAuditorium.com
 http://www.FovealMounts.com




reply via email to

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