Changeset 35407 in project


Ignore:
Timestamp:
04/21/18 21:03:34 (4 months ago)
Author:
kon
Message:

locale does delayed init

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/4/srfi-19/trunk/srfi-19-timezone.scm

    r35402 r35407  
    3535;;
    3636
    37 (define-parameter local-timezone-locale #f
     37(define-parameter local-timezone-locale (current-timezone-components)
    3838  (lambda (x)
    3939    (cond
    40       ((or (not x) (timezone-components? x))
     40      ((timezone-components? x)
    4141        x )
    4242      (else
     
    5555;;
    5656
    57 (define (local-timezone-locale*)
    58   (or
    59     (local-timezone-locale)
    60     (begin
    61       (locale-setup)
    62       (local-timezone-locale (current-timezone-components))
    63       (local-timezone-locale) ) ) )
    64 
    65 ;;
    66 
    6757#;;Unusued
    6858(define (make-timezone-locale nam off dst?)
     
    7363
    7464(define (timezone-locale-name . tzc)
    75   (let ((tzc (optional tzc (local-timezone-locale*))))
     65  (let ((tzc (optional tzc (local-timezone-locale))))
    7666    (check-timezone-components 'timezone-locale-name tzc)
    7767    (let ((tzn (timezone-components-ref/dst? tzc 'dst-name 'std-name)))
     
    8272
    8373(define (timezone-locale-offset . tzc)
    84   (let ((tzc (optional tzc (local-timezone-locale*))))
     74  (let ((tzc (optional tzc (local-timezone-locale))))
    8575    (check-timezone-components 'timezone-locale-offset tzc)
    8676    (let ((tzo (timezone-components-ref/dst? tzc 'dst-offset 'std-offset)))
     
    9080
    9181(define (timezone-locale-dst? . tzc)
    92   (let ((tzc (optional tzc (local-timezone-locale*))))
     82  (let ((tzc (optional tzc (local-timezone-locale))))
    9383    (check-timezone-components 'timezone-locale-offset tzc)
    9484    (timezone-component-ref tzc 'dst?) ) )
     
    10797  (cond
    10898    ((not tzi)                    (utc-timezone-locale))
    109     ((boolean? tzi)               (local-timezone-locale*))
     99    ((boolean? tzi)               (local-timezone-locale))
    110100    ((timezone-components? tzi)   tzi)
    111101    ((fixnum? tzi)                tzi)
Note: See TracChangeset for help on using the changeset viewer.