From 52e34076da56c4664d45065c1ba01ef4d2c03f55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Sun, 26 Jan 2020 04:57:04 +0100 Subject: Made printer more stable. --- module/srfi/srfi-19/alt.scm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'module/srfi') diff --git a/module/srfi/srfi-19/alt.scm b/module/srfi/srfi-19/alt.scm index b3e8a478..ccc58b8f 100644 --- a/module/srfi/srfi-19/alt.scm +++ b/module/srfi/srfi-19/alt.scm @@ -35,8 +35,12 @@ (set-record-type-printer! (lambda (r p) - (format p "~4'0d­~2'0d­~2'0d" - (year r) (month r) (day r)))) + (if (or (not (integer? (year r))) + (not (integer? (month r))) + (not (integer? (day r)))) + (format p "BAD~s-~s-~s" (year r) (month r) (day r)) + (format p "~4'0d-~2'0d-~2'0d" + (year r) (month r) (day r))))) (define*-public (date key: (year 0) (month 0) (day 0)) (make-date year month day)) -- cgit v1.2.3