From f6a32e7ff6409b94c78036483f4a76ed2fc4cff5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Pant=C5=AF=C4=8Dek?= Date: Wed, 10 May 2023 14:49:20 +0200 Subject: [PATCH] Calendar day module compilation. --- src/Makefile | 5 +++++ src/cal-day.scm | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Makefile b/src/Makefile index af208ee..d116e07 100644 --- a/src/Makefile +++ b/src/Makefile @@ -365,3 +365,8 @@ CAL-PERIOD-SOURCES=cal-period.scm cal-month.import.scm \ cal-period.o: cal-period.import.scm cal-period.import.scm: $(CAL-PERIOD-SOURCES) + +CAL-DAY-SOURCES=cal-day.scm util-tag.import.scm cal-month.import.scm + +cal-day.o: cal-day.import.scm +cal-day.import.scm: $(CAL-DAY-SOURCES) diff --git a/src/cal-day.scm b/src/cal-day.scm index 77325fe..bafde01 100644 --- a/src/cal-day.scm +++ b/src/cal-day.scm @@ -53,8 +53,10 @@ y m d)) ;; Returns true if this is a leap year - (define (cal-year-leap y) - #f) + (define (cal-year-leap? y) + (and (= (modulo y 4) 0) + (or (not (= (modulo y 100) 0)) + (= (modulo y 400) 0)))) ;; Returns the number of days of given month (define (cal-month-days y/m . ms)