Merge branch 'master' of github.com:davazp/jscl
authorDavid Vázquez <davazp@gmail.com>
Thu, 20 Jun 2013 12:26:53 +0000 (14:26 +0200)
committerDavid Vázquez <davazp@gmail.com>
Thu, 20 Jun 2013 12:26:53 +0000 (14:26 +0200)
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.

src/numbers.lisp
tests/numbers.lisp

index 3490df9..578d0b1 100644 (file)
@@ -81,7 +81,7 @@
 (macrolet ((def (name comparison)
              `(defun ,name (x &rest xs)
                 (dolist (y xs) 
-                  (unless (,comparison x (car xs))
+                  (when (,comparison y x)
                     (setq x y)))
                 x)))
   (def max >)
index 811d423..ae3ebb9 100644 (file)
@@ -8,11 +8,13 @@
 (test (= (max 1)     1))
 (test (= (max 1 2 3) 3))
 (test (= (max 3 2 1) 3))
+(test (= (max 1 2 3 4 5) 5))
 
 ;;; MIN
 (test (= (min 1)     1))
 (test (= (min 1 2 3) 1))
 (test (= (min 3 2 1) 1))
+(test (= (min 9 3 8 7 6 3 3) 3))
 
 ;;; EVENP
 (test      (evenp  2))