Corrected computing of min and max of defenum.

Pascal J. Bourguignon [2020-10-12 17:13]
Corrected computing of min and max of defenum.
Filename
common-lisp/cesarum/utility.lisp
diff --git a/common-lisp/cesarum/utility.lisp b/common-lisp/cesarum/utility.lisp
index 0d223c6..a2c578f 100644
--- a/common-lisp/cesarum/utility.lisp
+++ b/common-lisp/cesarum/utility.lisp
@@ -414,10 +414,10 @@ CONSTANTS:  The first element of CONSTANTS may be an optional docstring.
                            :do (when (consp cname)
                                  (setf val (1- (second cname))
                                        cname (first cname)))
-                               (if min (setf min (min min val)) (setf min val))
-                               (if max (setf max (max max val)) (setf max val))
                            :collect `(defconstant ,cname ,(incf val)
-                                       ,(format nil "~A enumeration value." name)))))
+                                       ,(format nil "~A enumeration value." name))
+                           :do (if min (setf min (min min val)) (setf min val))
+                               (if max (setf max (max max val)) (setf max val)))))
       (push `(defconstant ,(scat name '-min) ,min
                ,(format nil "The minimum ~A enumeration value." name))
             defconstants)
ViewGit