On 12/10/2012 09:02 PM, Dale Lukas Peterson wrote:
Just as a suggestion: instead of an introduction of a separate method set_TeX_name(), may be simpler to modify set_name() to have an optional second argument for the Tex name (similar to the symbol() method).
Here are the three options I can see. First, a default parameter as I think you are suggesting:
void set_name(const std::string& n, const std::string& texname = "") { name = n; TeX_name = texname; }
Second, overloading set_name:
void set_name(const std::string& n) { name = n; } void set_name(const std::string& n, const std::string& texname) { name = n; TeX_name = texname; }
Third, the option I originally proposed:
void set_TeX_name(const std::string& n) { TeX_name = n; }
I prefer my original proposal since it seems the most orthogonal to me. But any of them is really fine with me so that there is a way to change the TeX_name after you've created an instance of symbol. If there is interest in keeping fewer methods, then I guess one of the first two options would be preferable.
Well, Option 1 breaks the binary interface. Option 2 doesn't. And option 3 clearly doesn't either. Just my 2c -richy. -- Richard B. Kreckel