Change timestamp-compare to <=>

release
Doug Coleman 2007-10-31 14:37:29 -05:00
parent ac208e23ff
commit 497be591c8
2 changed files with 5 additions and 5 deletions

View File

@ -126,16 +126,16 @@ continuations system ;
2004 1 1 13 30 0 0 make-timestamp = ] unit-test
[ 0 ] [ 2004 1 1 13 30 0 0 make-timestamp
2004 1 1 12 30 0 -1 make-timestamp compare-timestamps ] unit-test
2004 1 1 12 30 0 -1 make-timestamp <=> ] unit-test
[ 1 ] [ 2004 1 1 13 30 0 0 make-timestamp
2004 1 1 12 30 0 0 make-timestamp compare-timestamps ] unit-test
2004 1 1 12 30 0 0 make-timestamp <=> ] unit-test
[ -1 ] [ 2004 1 1 12 30 0 0 make-timestamp
2004 1 1 13 30 0 0 make-timestamp compare-timestamps ] unit-test
2004 1 1 13 30 0 0 make-timestamp <=> ] unit-test
[ 1 ] [ 2005 1 1 12 30 0 0 make-timestamp
2004 1 1 13 30 0 0 make-timestamp compare-timestamps ] unit-test
2004 1 1 13 30 0 0 make-timestamp <=> ] unit-test
[ t ] [ now timestamp>unix-time millis 1000 /f - 10 < ] unit-test
[ t ] [ 0 unix-time>timestamp unix-1970 = ] unit-test

View File

@ -205,7 +205,7 @@ M: number +second ( timestamp n -- timestamp )
: >gmt ( timestamp -- timestamp )
0 convert-timezone ;
: compare-timestamps ( tuple tuple -- n )
M: timestamp <=> ( ts1 ts2 -- n )
[ >gmt tuple-slots ] compare ;
: timestamp- ( timestamp timestamp -- seconds )