Karim BELABAS on Sat, 14 Dec 2002 20:54:01 +0100 (MET)

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PATCH CVS] TeX output

On Sat, 14 Dec 2002, Ilya Zakharevich wrote:

> On Sat, Dec 14, 2002 at 07:49:56PM +0100, Karim BELABAS wrote:
> > On Tue, 22 Oct 2002, Ilya Zakharevich wrote:
> > > This patch:
> > >
> > >   a) Introduces a new function Str1(expr,{flag=0}) which is somewhat similar
> > >      to Str(), but
> > >
> > > 	1) Takes an expression, not a string as the first argument;
> > I do not like 1). Since we're making a string of it anyway, having prototype
> > 's' instead of 'G' only means restricting the way the function may be used.
> Yes.  So what is your point?  In fact in this case having the
> prototype 's' is so restrictive that the function would not be
> implementable...

Sorry, I meant the exact opposite: having prototype 'G' instead of 's' is
retrictive (from the _user_ point of view); not the other way round. Of
course, from the _implementor_ point of view, once the objects have been
converted to string representation, converting to TeX is impossible. So I
implemented the routine using the 's*' prototype.

> > "String context" may be a debatable feature [ I think it was a mistake to
> > introduce it ], but it's there, documented, and it's important to maintain
> > consistency.
> I have no idea what you mean here.  It is impossible to convert the
> string representation to TeX representation.

True. Please update from CVS and see what my patch does ( try
Str/Strexpand/Strtex ).

>> Note: I don't really see the point of getting the char value ( Str1(,2) ),
>> since Vecsmall does it in a more usable form ( translates a full string if
>> necessary, not a single char ).
> See another message of mine: I object to Vec and Vecsmall having
> different semantic.

Is it really different semantic ? The Vec/Vecsmall routines (more generally
all the type conversion functions) convert an object to the relavant type,
whenever it is possible.

  Vec("abc") --> ["a", "b", "c"]

is quite natural ( as opposed to the equally natural but less useful ["abc"] )

Since Vecsmall("abc") --> Vecsmall("a", "b", "c") is impossible, it is
sensible to "typecast" the chars to integers as suggested by Michael Somos [I
think]. It looks better than to have an error message.


Karim Belabas                    Tel: (+33) (0)1 69 15 57 48
Dép. de Mathématiques, Bât. 425  Fax: (+33) (0)1 69 15 60 19
Université Paris-Sud             Email: Karim.Belabas@math.u-psud.fr
F-91405 Orsay (France)           http://www.math.u-psud.fr/~belabas/
PARI/GP Home Page: http://www.parigp-home.de/