Charles Greathouse on Wed, 13 Nov 2013 20:20:25 +0100


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

Slicing lists?


The vector slicing notation introduced in 2.6.0 is very convenient. Could this be extended to lists?

I haven't tested it but I think this would amount to adding

        case t_LIST:
            A = list_data(A);
            GEN B = cgetg(lB, t_VEC);
            for (i=1; i<lB; i++) gel(B,1+i) = gcopy(gel(A,i+y1));
            return B;

to vecslice0.

Charles Greathouse
Analyst/Programmer
Case Western Reserve University