Angus Leeming <[EMAIL PROTECTED]> writes: | Andre Poenitz wrote: > >>> And I am trying to get rid of the big switch. >> >> How should that work? >> >> [Note that individual LFUN handler functions are a pain in the ass. I >> had this once working in mathed and it required much more typing, >> recompilation time and general hand holding than the big switch. Most >> notably, adding a new LFUN specific to a single inset or two meant >> recompilation of the whole tree. The big switch is certainly not >> 'Nice', but works and is easily maintained once there is nothing more >> than the big switch in dispatch(). But I guess you won't accept that >> until you tried that by yourself...] > | Wouldn't you have a base class | class LFun { | virtual void dispatch(string const & arg) const = 0; | }; > | and thereafter have | class LFunCitation { | virtual void dispatch(string const & arg) const; | }; > | I have no idea how you'd find the correct inset though...
No, that is not my idea. btw. I am also fiddling with the idea of dropping the kb_action enum, and just use strings all over... (with a hash_map if available) -- Lgb