add date*' and exn:fail:syntax:unbound'

The `date*' structure type is an extension of `date' with
`nanosecond' and `time-zone-name' fields.

The `seconds->date' function now accepts a real and returns a
`date*'. The fractional part of its argument goes into the
`nanosecond' field.

original commit: ac8990d5195312fa7c71966bdfaa925905902ca8
This commit is contained in:
Matthew Flatt 2011-09-28 20:20:05 -06:00
parent ee460be5b2
commit e85c17b090

View File

@ -7,10 +7,10 @@
(let* ([now (seconds->date (current-seconds))]
[v (modulo (add1 (date-second now)) 60)])
(test #t equal? now (copy-struct date now))
(test #f equal? now (copy-struct date now (date-second v)))
(test v date-second (copy-struct date now (date-second v)))
(test (date-year now) date-year (copy-struct date now (date-second v))))
(test #t equal? now (copy-struct date* now))
(test #f equal? now (copy-struct date* now (date-second v)))
(test v date-second (copy-struct date* now (date-second v)))
(test (date-year now) date-year (copy-struct date* now (date-second v))))
(err/rt-test (copy-struct date 10))
(err/rt-test (copy-struct date 10 (date-second 0)))