> The current linear support relies upon recursion (at least in writing to
> files) and duplication of code to place the end markers and control
> output. If we move everything to Insets then the export routines are
> dependent upon Insets (either as member functions of the Inset or as
> multiple-dispatched separate functions) so it makes more sense to have
> environments stored hierarchically since we know exactly when to output
> end markers.  Then there is no duplication of code and the recursion (now
> encapsulation) is explicit in the data structures and not just in some
> convoluted code. 

We can still have "local" end-tags in each inset-writers in the linear
approach.  It's simply a question about having the Writers to maintain a stack
of end-tags.  When ever we drop out a nesting level, an end-tag is popped from
the stack and written to the file.
When ever we enter a new nesting level, we spit out a start-tag and push an
end-tag to the stack.

No need for the hierarchy approach to solve this little problem.

Greets,

Asger

Reply via email to