[GiNaC-list] set_TeX_name() ?

Dale Lukas Peterson hazelnusse at gmail.com
Tue Dec 11 11:21:38 CET 2012


Does anybody else (i.e., developers or other users) have any comments
regarding these methods for changing the TeX_name data member?  This
is a minor change and I think it would be nice to have the
functionality.

Thanks,
Dale

On Mon, Dec 10, 2012 at 12:02 PM, Dale Lukas Peterson
<hazelnusse at gmail.com> 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.
>
> Thanks,
> Dale



-- 
“People call me a perfectionist, but I'm not. I'm a rightist. I do
something until it's right, and then I move on to the next thing.”
― James Cameron


More information about the GiNaC-list mailing list