Created
May 16, 2017 13:10
-
-
Save kuanyui/bd014e589eb9922129f96e5caca904de to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defun sort-ip (ip-list) | |
| (sort ip-list #'>ip)) | |
| (defun >ip (a b) | |
| (if (and (null a) (null b)) | |
| nil | |
| (let ((x (car a)) | |
| (y (car b))) | |
| (cond ((> x y) t) | |
| ((< x y) nil) | |
| (t (>ip (cdr a) (cdr b))) | |
| )))) | |
| (sort-ip '((192 168 1 20) (1 1 1 1) (255 0 0 0) (192 168 1 1) (192 16 2 20) (192 168 1 1) (111 168 1 20))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment