A=vector(100,i,i);
for(i=35,99, print1(vecextract(A,1<<i)))
for(i=20,25, print(vecextract(A,1<<100-2-1<<i-1<<(2*i)-1<<(3*i))))
vecextract(A,"2..4")
vecextract(A,"-2..-4")
vecextract(A,"^65")
vecextract(A,"^2..99")
vecextract(A,"^99..2")
vecextract(A,Vecsmall([3,5]))

A=matid(3);
vecextract(A,"2..","..")
vecextract(A,"-2..","-1..")
matsize(vecextract(A, 0, 3))
matsize(vecextract(A, [], 3))
matsize(vecextract(A, "2..3", []))
matsize(vecextract(A, [1,2], []))
matsize(vecextract(A, Vecsmall([1,2]), []))
matsize(vecextract(matid(6), 3, 0))

fun = [Vec,Vecrev,Col,Colrev,Vecsmall];
obj = [1, 'x, 1/x, Pol([5,4,3,2,1]), x+2*x^2+O(x^3),[1,2], Vecsmall([1,2]), List([1,2,3]), List([1,2,3,4,5]), "ab", [1,2,3;3,4,5], iferr(1/0,E,E)];
test(f)= print(f);[ print(iferr(f(p),E,E)) | p<-obj ];
[if(1,test(f); test(x->f(x,4)); test(x->f(x,-4))) | f <- fun];
test(x->component(x,2));
test(x->component(x,10));

test(x->polcoef(x,-1));
test(x->polcoef(x,2));
test(x->polcoef(x,10));
polcoef(O(x),0)
s=x*(y+O(x))+y;
polcoef(s,0,y)
polcoef(s,1,y)
s=y+O(y^2);
polcoef(s,0,x)
polcoef(s,1,x)
s=1/(1-2*x+O(x^3)) * 1/(1-3*y+O(y^3)); polcoef(s,2,y)

vecextract(Vecsmall([3,4,5]),[2,3,1])
vecextract([1], 11)
vecextract([1], "1..2")
vecextract([1], 1/2)
vecextract(1, 1)
vecextract(matid(2),[3],[])
[1][2..3]
[1][-10..3]
1[1..2]
[1/2..1]
[1..1/2]
