Neil Hodgson wrote:
Valik:

  Not really as it uses mutable global data rather than instance data
which is the wrong direction for the code to move in. A nice approach
would use some form of function object that tied the string and
callable together to pass around. It may be simpler here to recognise
there is only a couple of choices that can be coded as member
functions and pass a boolean or enum rather than a function pointer to
choose. IIRC this was Philippe's feature and he may have an idea where
to take this.

  Neil

Okay.  Then what about this approach?

The two current functions are made into non-static (protected?) member functions of SciTEBase and all the calls are modified to pass around member functions. Then a new member function can be added which does what I want. This basically keeps the original design intact except it moves everything into SciTEBase so that property access is possible.

The first approach you mention seems overly complicated for such a simple feature. I would rather not do the second approach unless that is your preference. My preference is to use functions to return data in cases like this instead of a single function taking flags. I've found that a single function returning different values based on a flag is more confusing than separate functions without the flag business.

--
- Valik
_______________________________________________
Scite-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scite-interest

Reply via email to