From ada4a7aeaedd2ab56255d3bc0b33cc2f76bdaa99 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Wed, 18 Feb 2009 21:29:58 +0000 Subject: [PATCH] allow negative years in a 'date' structure svn: r13728 --- collects/scribblings/reference/time.scrbl | 2 +- src/mzscheme/src/struct.c | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/collects/scribblings/reference/time.scrbl b/collects/scribblings/reference/time.scrbl index ac484daaa8..ca72c8637b 100644 --- a/collects/scribblings/reference/time.scrbl +++ b/collects/scribblings/reference/time.scrbl @@ -33,7 +33,7 @@ portability is needed.} [hour (integer-in 0 23)] [day (integer-in 1 31)] [month (integer-in 1 12)] - [year exact-nonnegative-integer?] + [year exact-integer?] [week-day (integer-in 0 6)] [year-day (integer-in 0 365)] [dst? boolean?] diff --git a/src/mzscheme/src/struct.c b/src/mzscheme/src/struct.c index 1f0472e9a7..8c0c3d0753 100644 --- a/src/mzscheme/src/struct.c +++ b/src/mzscheme/src/struct.c @@ -3694,9 +3694,8 @@ static Scheme_Object *check_date_fields(int argc, Scheme_Object **argv) if (!SCHEME_INTP(a) || (SCHEME_INT_VAL(a) < 1) || (SCHEME_INT_VAL(a) > 12)) scheme_wrong_field_type(argv[10], "integer in [1, 12]", a); a = argv[5]; - if ((!SCHEME_INTP(a) || (SCHEME_INT_VAL(a) < 0)) - && (!SCHEME_BIGNUMP(a) || !SCHEME_BIGPOS(a))) - scheme_wrong_field_type(argv[10], "nonnegative exact integer", a); + if (!SCHEME_INTP(a) && !SCHEME_BIGNUMP(a)) + scheme_wrong_field_type(argv[10], "exact integer", a); a = argv[6]; if (!SCHEME_INTP(a) || (SCHEME_INT_VAL(a) < 0) || (SCHEME_INT_VAL(a) > 6)) scheme_wrong_field_type(argv[10], "integer in [0, 6]", a);