Browse Source

Rewrote leap-year-p

Samuel W. Flint 8 years ago
parent
commit
ef63099429
1 changed files with 5 additions and 3 deletions
  1. 5 3
      isodate.lisp

+ 5 - 3
isodate.lisp

@@ -76,9 +76,11 @@
     (parse-integer text)))
 
 (defun leap-year-p (year)
-  (or (= (mod year 4) 0)
-     (= (mod year 100) 0)
-     (= (mod year 400) 0)))
+  (cond
+    ((= 0 (mod year 4)) t)
+    ((= 0 (mod year 100)) nil)
+    ((= 0 (mod year 400)) t)
+    (t nil)))
 
 (defrule whole-date
     (and year (? (and "-" month (? (and "-" day)))))