We should make a way to ensure that LyXFunc are called with the
correct number of arguments and also that the arguments are of the
correct type. I think I have a nice solution for this...first we
change the LyXFunc::dispatch to a different type of arg...

LyXFunc::dispatch(FuncSlot const & funcslot);

where funcslot is something like:

class FuncSlot {
public:
        FuncSlot(string const & func);
        FuncSlot & arg(string const & a);
private:
        string func_;
        vector<string> argList;
};

to be used like this:

lyxfunc.dispatch(FuncSlot("buffer-new").arg("newfile"));

It is also easy to enhance this so that arg can take any type.
(see next mail about stream_cast<>)

        Lgb

Reply via email to