bug-groff
[Top][All Lists]
Advanced

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

[bug #60954] [troff] implement environment renaming and/or removal


From: Dave
Subject: [bug #60954] [troff] implement environment renaming and/or removal
Date: Tue, 15 Mar 2022 23:37:41 -0400 (EDT)

Follow-up Comment #7, bug #60954 (project groff):

[comment #6 comment #6:]
> I think that's the problem.  We don't know where to go in
> our evasion if we traverse into a deleted node.

I admit I haven't looked at the code.  But deducing how it works based on the
behavior ("the grand thing is to be able to reason backwards" -- Sherlock
Holmes), it seems there must be two separate sets of objects: a data structure
containing all the information associated with an environment (I'll call it
the "EDS" here to avoid having to take two minutes to look at the code and
find out its proper name; see "rat seeking minimum of effort"), indexed by the
environment name; and a stack containing a list of names of environments.  The
notable fact that an environment can appear on the stack multiple times seems
to preclude the EDS itself from containing the pointers that comprise the
stack, else multiple pushes of the same environment would create less a stack
and more a pretzel.  And an EDS can't be created anew on every push, else
changes to one structure on the stack wouldn't propagate to other stack nodes
with the same name.

So freeing a single EDS (what I think of as a "delete") seemingly wouldn't
affect the stack, because the behavior seems to dictate this is maintained
separately.  The stack may in reality contain pointers to EDSes rather than
strings of names, but those pointers _can_ be null without a problem: the
"next" pointer is the only thing you need to navigate your way back down the
stack, and I see no way this can be part of an EDS itself.  But maybe James
Clark has done something cleverer than I can dream up.

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?60954>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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