Karim Belabas on Sun, 31 Jul 2011 08:42:24 +0200


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

Re: Ser(Vecsmall(0))


* Michael Somos [2011-07-31 07:14]:
> Currently Ser() can't deal with Vecsmall:
> 
> ? Ser(Vecsmall(0))
>   ***   at top-level: Ser(Vecsmall(0))
>   ***                 ^----------------
>   *** Ser: incorrect type in gtoser.
> 
> I see no reason that it should be any
> different than with Vec. Similarly:

Agreed. Committed to svn.

> ? lex(Vecsmall(1),Vecsmall(2))
>   ***   at top-level: lex(Vecsmall(1),Vecs
>   ***                 ^--------------------
>   *** lex: incorrect type in comparison.
> 
> I see no reason that lex should have
> a problem comparing Vecsmall. Shalom,

This one is more annoying. lex() is able to compare objects of
different type, so that allowing t_VECSMALL would complicate the code
quite a bit for a tiny increase in functionality [ need to also update
lexcmp_scal_vec(), lexcmp_vec_mat() in addition to the lexcmp() body ]

We now (= 2.6.* testing branch) have a "universal comparison function" cmp().
Can't one just use this ?

Cheers,

    K.B.
--
Karim Belabas, IMB (UMR 5251)  Tel: (+33) (0)5 40 00 26 17
Universite Bordeaux 1          Fax: (+33) (0)5 40 00 69 50
351, cours de la Liberation    http://www.math.u-bordeaux1.fr/~belabas/
F-33405 Talence (France)       http://pari.math.u-bordeaux1.fr/  [PARI/GP]
`