Changeset 38124 in project


Ignore:
Timestamp:
01/16/20 02:29:37 (9 months ago)
Author:
Kon Lovett
Message:

simplify timezone-offset?, range check for tz offset, reflow

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/5/locale/trunk/locale-components.scm

    r37385 r38124  
    2222  locale-component-exists?
    2323  set-locale-component!
     24  #;delete-locale-component!  ;UNFINISED
    2425  update-locale-components!
    2526  ;
     
    121122      lc ) ) )
    122123
    123 #;
     124#; ;UNFINISED
    124125(define (*delete-locale-component! loc lc what)
    125   (check-symbol loc what 'key)
    126126  (if (null? lc)
    127127    lc
     
    230230    what value check-locale-component) )
    231231
    232 #;
     232#; ;UNFINISED
    233233(define (delete-locale-component! lc what)
    234234  (*delete-locale-component! 'delete-locale-component!
    235235    (check-locale-components 'delete-locale-component! lc)
    236     what check-locale-component) )
     236    (check-symbol 'delete-locale-component! what 'key)) )
    237237
    238238(define (update-locale-components! lc . args)
     
    246246
    247247(define-constant SEC/DY 86400)
    248 (define (timezone-offset? obj)
    249   (and
    250     (fixnum? obj)
    251     (let (
    252       (atzo (fxabs obj)) )
    253       (and (fx<= 0 atzo) (fx< atzo SEC/DY)))) )
     248
     249(define-constant MAX-TZI SEC/DY)
     250(define-constant MIN-TZI (- MAX-TZI))
     251
     252(define (timezone-offset? x) (and (fixnum? x) (< MIN-TZI x MAX-TZI)))
    254253
    255254(define-check+error-type timezone-offset)
Note: See TracChangeset for help on using the changeset viewer.