Re: word processor document format: what parts?
- From: Keith Wright <kwright tiac net>
- To: gnome-list gnome org
- Subject: Re: word processor document format: what parts?
- Date: Mon, 21 Sep 1998 02:09:53 -0400
> From: "J. Patrick Narkinsky" <patrick@narkinsky.ml.org>
> If we took the '<bold-italic></bold-italic>' approach for all the possible
> combinations of say, 50 tags, we would be looking at like 50^50
> combinations. (Anyone who really groks probability and such feel free to
> correct me).
50^2
> And that only covers the two tag combinations -- not the
> three, four, and five layer deep nesting. To cover a maximum of 5 layers
> of recursion avoiding a recursive approach using a mechanism as outlined
> above, we'd be looking at something like ((((50!)!)!)!)!).
50^5
> My scientific calculator chokes on this after the 2nd factorial.
Indeed. But if I typed at a billion Giga Hz for the rest of the lifetime
of the universe I would not be close to saying how wrong you are.
The correct answer is 312,500,000.
Though your math sucks, I agree with your conclusion. Three hundred
thousand is still too many special cases to code. (And five far too
shallow a nesting limit.)
I don't think I believe the alleged difficulty of handling the recursive
nesting. You don't have to traverse to the root of the tree after each
keystroke. You just keep a stack of unclosed context tags, and the
current typesetting parameters (font, margins, etc). When you
hit a new tag you push it on the stack and update the parameters.
When you hit an end tag you pop and restore. (Much hard work has
been glossed over, but there is no showstopper at square one.)
Final thought: Hasn't LyX been down this road before? What does
it take to substitute XML for LaTeX? The TeX language suffers from
a macro system that mixes the content with the style sheet and with
rude hacking. LaTeX fixes that somewhat. Despite such room for
improvement in the input language, the end result is _excellent_,
and I don't think you can come close to that quality without another
Knuth ready to put another twenty years into it. I'd hate to throw
it away and start over.
--
--Keith
This mail message sent by GNU emacs and Linux.
Food, Shelter, Source code.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]