#| -*-Scheme-*-
-$Id: object.scm,v 1.4 2000/03/20 22:52:51 cph Exp $
+$Id: object.scm,v 1.5 2000/03/31 14:15:09 cph Exp $
Copyright (c) 1988, 1991, 1999, 2000 Massachusetts Institute of Technology
(unparser/standard-method 'rcsdelta
(lambda (state delta)
(unparse-string state (delta/number delta)))))
-\f
-(define *date-rounds-to-day?* #f)
(define (date/make year month day hour minute second)
(let ((year (if (< year 100) (+ 1900 year) year)))
(let ((dt (make-decoded-time second minute hour day month year 0)))
- (cons dt
- (decoded-time->universal-time
- (if *date-rounds-to-day?*
- (make-decoded-time 0 0 0 day month year 0)
- dt))))))
+ (vector dt
+ (decoded-time->universal-time dt)
+ (decoded-time->universal-time
+ (make-decoded-time 0 0 0 day month year 0))))))
+
+(define (date/decoded date) (vector-ref date 0))
+(define (date/universal date) (vector-ref date 1))
+(define (date/day date) (vector-ref date 2))
-(define-integrable (date/decoded date) (car date))
-(define-integrable (date/universal date) (cdr date))
+(define (date->string date) (decoded-time->string (date/decoded date)))
-(define-integrable (date->string date)
- (decoded-time->string (date/decoded date)))
+(define (date<? x y) (< (date/universal x) (date/universal y)))
+(define (date=? x y) (= (date/universal x) (date/universal y)))
+(define (date>? x y) (> (date/universal x) (date/universal y)))
-(define-integrable (date<? x y)
- (< (date/universal x) (date/universal y)))
\ No newline at end of file
+(define (day<? x y) (< (date/day x) (date/day y)))
+(define (day=? x y) (= (date/day x) (date/day y)))
+(define (day>? x y) (> (date/day x) (date/day y)))
\ No newline at end of file