groff
[Top][All Lists]
Advanced

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

Re: [Groff] proposal: add variable traps to groff.


From: Klaus Robert Suetterlin
Subject: Re: [Groff] proposal: add variable traps to groff.
Date: Fri, 01 Oct 2004 15:53:47 +0200

Dear Werner,

> It's not really clear to me what you want to do with that interface.
> Are you interested in better debugging facilities?  Or do you have
> something different in mind?

short answer:

        Yes. Yes.

Regards, Robert S.
--

long answer:

I do not know what the rational behind the current traps is / was.
Still they show that traps (do something _when_ some condition
becomes true) are useful in groff.  To make simple what is otherwise
difficult and possible what is impossible without them.

The problem I was pondering when I had the idea for a register trap
was the following:

mgm really does awful stuff if You change the pagelength behind its
back.  So it provides a macro PGFORM for that purpose.  And this
macro wrapper makes sure that every implementation detail (esp. .wh
traps) is updated.  At least it tries, but the reference mentions
that it sometimes fails... and recommends to use the command line
switches.

In addition several number registers are changed by special purpose
requests.  For example the read only \n[.p] is set using .pl.  This
is I guess because the groff implementation itself has to maintain
a .vpt at the bottom of the page, so groff must notice when \n[.p]
changes.

So the request .pl is the groff engine wrapper macro for .nr .p.
Then there comes another layer of macro wrappers from the macro
package (i.e. PGFORM and friends in mgm) that wrap .pl.  And so on.

I am using tcl quite a lot nowadays and I found its variable traps
useful in handling multiple access to a single variable.  Maybe
this is why I thought about having register traps in groff.  This
might be a dumb idea, I do not know.  I am just a macro user, so I
might completely miss the point here.




reply via email to

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