How sort list?



aleksas.domarkas at post.skynet.lt a ?crit :
> Let
> S:[[5,1],[4,2],[3,5],[2,3],[1,4]]
> I need a function f, such that
> sort(S,f)
> get
> [[1,4],[4,2],[2,3],[3,5],[5,1]]

I think that
- either you need to solve some general sorting problem, then you have 
to precise it, and this gives you a clue to what the function f might be
- or you just need to treat this particular numerical example (I can't 
imagine why) and you may just construct an ad hoc function, for instance :
g(x):=if x=[1,4] then 1 else if x=[4,2] then 2 else if x=[2,3] then 3 
else if x=[3,5] then 4 else if x=[5,1] then 5 else 0 ;
f(x,y):=g(x)<g(y);

Eric
> ------------------------------------------------------------------------
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>