Changeset 39870 in project


Ignore:
Timestamp:
04/07/21 01:04:08 (2 weeks ago)
Author:
Kon Lovett
Message:

reflow

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/5/srfi-19/trunk/srfi-19-date.scm

    r38336 r39870  
    631631  milliseconds    (millisecond millis milli ms)    date-adjuster-duration
    632632  microseconds    (microsecond micros micro us)    date-adjuster-duration
    633   nanoseconds     (nanosecond nanos nano ns)       date-adjuster-duration
    634 )
    635 
    636 (define +date-key-lexographic-order+ '(
     633  nanoseconds     (nanosecond nanos nano ns)       date-adjuster-duration)
     634
     635;UNUSED
     636#|
     637(define +date-key-lexical-order+ '(
    637638  years
    638639  quarters
     
    645646  milliseconds
    646647  microseconds
    647   nanoseconds
    648 ))
    649 
    650 (define (date-key= a b)
    651   (eq? a b) )
    652 
    653 (define (date-key< a b)
    654   (negative? (date-key-compare a b)) )
     648  nanoseconds))
     649
     650(define (date-key-order x) (list-index (cut eq? x <>) +date-key-lexical-order+))
    655651
    656652(define (date-key-compare a b)
    657   (-
    658     (list-index (cut eq? a <>) +date-key-lexographic-order+)
    659     (list-index (cut eq? b <>) +date-key-lexographic-order+)) )
     653  (if (eq? a b) 0 (- (date-key-order a) (date-key-order b))) )
     654
     655(define (date-key=? a b) (zero? (date-key-compare a b)))
     656(define (date-key<? a b) (negative? (date-key-compare a b)))
     657|#
    660658
    661659) ;module srfi-19-date
Note: See TracChangeset for help on using the changeset viewer.