André argues that we should not use XTL because we can do things with
a string.  He thinks that the added complexity of another library is
not worth the hassle -- after all a text format is well-known, and
if it is well encapsulated, it's no problem.

Surprise!

This is exactly what XTL is:  A well encapsulated and easy to use library.  

You argue that debugging is important.  Three words: Debugging is boring.

If we use XTL, there will be less debugging than if we have to write
our own parser.  Just take a look at any parser we have in LyX.  Every
one of them is problematic, and has causes bugs.  If for nothing else,
them simply because it actual is hard to keep a list sorted!

Now, maybe you can find a better encapsulation than what we currently
have.  Good for you, but I already found the best encapsulation. It's
called XTL.

By the way, did you know that XTL provides an easily debugable text
format?  Not that you would ever need to use it, except when you have
to convince somebody to drop old fashioned methods.

> Tons of interfaces?

All dialogs require an interface to the kernel to get the information
that should go in the dialog.

> Conversion of strings and stream is niot difficult, too...

It is more difficult than using XTL.
It is less secure than XTL.
It is less sexy than XTL.

> > The neat part about XTL is obviously that you only have to implement
> > one method for each structure to get both read and write functionality.
> 
> Do you think this will be much easier than:
> 
>    function(istream & inputstream, ostream & outputstream, ostream & err.. )
>    {
>      int par1, par2;
>      inputstream >> par1 >> par2;
> 
>      if (!inputstream) {
>        errorstream << "funny parameters";
>        return;
>      }
>      
>      outputstream << "some rtesult";
>    }
> 
> I don't think, this will be possible.      

Think again.

Have a look at XTL. Let me wing you an example.  I can make it more
complex if you want to, but maybe you would not understand what we
are talking about:

struct Foo {
        vector<int> data1;
        list<pair<int, char> > data2;
        string data3;
        template<X>
        void simple(X x) {
                X.simple(data1).simple(data2).simple(data3);
        }
};

There you have all your externalization code, both for input and output.
You can't beat that, now can you?

If you think so, you must be drunk.  Come to Norway and I'll buy you a beer.

Greets,

Asger

Reply via email to