[GiNaC-list] set_TeX_name() ?
Felipe Bordeu
felipe.bordeu at ec-nantes.fr
Tue Dec 11 11:29:37 CET 2012
I like the idea of adding a new method:
void set_TeX_name(const std::string & n)
because you can change the texname witdout doing something like:
symbol toto('sigma');
toto.set_name(toto.get_name(), "\sigma");
Felipe
Le 11/12/2012 11:21, Dale Lukas Peterson a écrit :
> 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
>
>
--
Felipe Bordeu Weldt
Ingénieur de Recherche
-------------------------------------
Tél. : 33 (0)2 40 37 16 57
Fax. : 33 (0)2 40 74 74 06
Felipe.Bordeu at ec-nantes.fr
Institut GeM - UMR CNRS 6183
École Centrale Nantes
1 Rue de La Noë, 44321 Nantes, FRANCE
-------------------------------------
More information about the GiNaC-list
mailing list