From cdff1a3fb0743936a138253202c8aec99bccca6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Tue, 5 Apr 2022 16:43:56 +0200 Subject: Minor fixups. --- module/datetime.scm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'module/datetime.scm') diff --git a/module/datetime.scm b/module/datetime.scm index 18c965ff..478fc479 100644 --- a/module/datetime.scm +++ b/module/datetime.scm @@ -65,6 +65,11 @@ (year year) (month month) (day day)) (define*-public (date key: (year 0) (month 0) (day 0)) + (unless (and (integer? year) (integer? month) (integer? day)) + (scm-error 'wrong-type-arg "date" + "Year, month, and day must all be integers. ~s, ~s, ~s" + (list year month day) + #f)) (make-date year month day)) (set-record-type-printer! @@ -72,7 +77,7 @@ (lambda (r p) (catch 'misc-error (lambda () (display (date->string r "#~Y-~m-~d") p)) - (lambda (err _ fmt args . rest) + (lambda (err proc fmt args data) (format p "#< BAD year=~s month=~s day=~s>" (year r) (month r) (day r)))))) -- cgit v1.2.3