newLISP Fan Club

Forum => newLISP in the real world => Topic started by: cameyo on May 28, 2021, 11:33:23 AM

Title: sort list of points
Post by: cameyo on May 28, 2021, 11:33:23 AM
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.
Title: Re: sort list of points
Post by: cameyo on May 28, 2021, 12:41:44 PM
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