aboutsummaryrefslogtreecommitdiff
path: root/module/srfi
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@hornquist.se>2020-01-26 04:57:04 +0100
committerHugo Hörnquist <hugo@hornquist.se>2020-01-26 04:57:04 +0100
commit52e34076da56c4664d45065c1ba01ef4d2c03f55 (patch)
treefbcd5ae687aec672d502fbbacb0d7ff417648cd1 /module/srfi
parentStart of new date structures. (diff)
downloadcalp-52e34076da56c4664d45065c1ba01ef4d2c03f55.tar.gz
calp-52e34076da56c4664d45065c1ba01ef4d2c03f55.tar.xz
Made <date> printer more stable.
Diffstat (limited to 'module/srfi')
-rw-r--r--module/srfi/srfi-19/alt.scm8
1 files changed, 6 insertions, 2 deletions
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!
<date>
(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))