On 22 Oct 1998, Lars Gullik Bj�nnes wrote:

> What I want of the Lyx file format is that it should be an direct
> mapping of the buffer structure, this makes it easy to parse and easy
> to write. We are not there yet, but we are a lot closer.

This is precisely the idea I disagree with. Matthias wrote his original
LyX format with that idea in mind, a good temporary solution. Actually
it's not true that an exact direct mapping of the buffer structure
guarantees an easier parsing and writting. On the contrary, it forces an
unnecessary dependence between the internal buffer structure and the file
format.

I think a better approach is this:

- Using STL words, the buffer structure is ultimately a container
  that holds the document's data. The STL way to have access to such
  data, either to get it or to modify it, is by iterators.

- When using an iterator you don't know the internal structure of
  the container, you only use the iterator's methods that let you
  do whatever you want to do with the data.
 
- We can have a set of iterators, depending on what we want to do with 
  the data. To parse and write, an even to draw on screen, a secuential
  iterator is good. To edit the buffer, we need an iterator that can be
  moved randomly (like the cursor).

This is rougly my idea about the subject, and nearly what I wanted to do
with mathed, though in a rudimentary way (there was not STL yet).

> Users looking at the file 
> might instead belive that this is LaTex or sgml, currently they will 
> never make that mistake. 

Of course not but I'm not really proud about it!  ;-)

Alejandro

Reply via email to