797 |
(define (leap-year? date) |
(define (leap-year? date) |
798 |
(priv:leap-year? (date-year date))) |
(priv:leap-year? (date-year date))) |
799 |
|
|
800 |
(define priv:month-assoc '((1 . 31) (2 . 59) (3 . 90) (4 . 120) |
;; Map 1-based month number M to number of days in the year before the |
801 |
(5 . 151) (6 . 181) (7 . 212) (8 . 243) |
;; start of month M (in a non-leap year). |
802 |
(9 . 273) (10 . 304) (11 . 334) (12 . 365))) |
(define priv:month-assoc '((1 . 0) (2 . 31) (3 . 59) (4 . 90) |
803 |
|
(5 . 120) (6 . 151) (7 . 181) (8 . 212) |
804 |
|
(9 . 243) (10 . 273) (11 . 304) (12 . 334))) |
805 |
|
|
806 |
(define (priv:year-day day month year) |
(define (priv:year-day day month year) |
807 |
(let ((days-pr (assoc month priv:month-assoc))) |
(let ((days-pr (assoc month priv:month-assoc))) |