Karim BELABAS on Sun, 15 Dec 2002 18:42:41 +0100 (MET)

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

Re: Vec vs Vecsmall

On Sun, 15 Dec 2002, Michael Somos wrote:
> As Ilya wrote :
> > IMO, Vecsmall() should be an *optimization* only.  The code which uses
> > Vecsmall() should not notice if Vecsmall() is aliased to Vec().
> this is a sensible point of view. As Karim explained, it is not possible
> for Vecsmall("a") to return "a", however, it is possible to go the other
> way round and have Vec("a") return what Vecsmall returns now. I don't
> think that there is much code which depends on the current behavior, and
> it needs only a bit of work to be modified for changed behavior. Shalom,
> Michael

But then we lose Vec("abc") --> ["a", "b", "c"].
Since there's no easy way to go from integer to character value
(e.g 97 --> 'a'), it is a net loss.

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/