sort list of points

Q&A's, tips, howto's
Locked
cameyo
Posts: 183
Joined: Sun Mar 27, 2011 3:07 pm
Location: Italy
Contact:

sort list of points

Post by cameyo »

How to sort a list of points (x y) with x ascending and y descending?
I have tried this, but don't work:
(define (comp x y) (and (>= (last x) (last y)) (<= (first x) (first y))))
I can't post all the code... Internal Server Error.

cameyo
Posts: 183
Joined: Sun Mar 27, 2011 3:07 pm
Location: Italy
Contact:

Re: sort list of points

Post by cameyo »

Solution found.
(define (cmp x y) (if (= (first x) (first y)) (g.t. (last x) (last y)) (l.t. (first x) (first y))))

Fortran operator g.t. and l.t. don't raise Internal Server Error

Locked