Ignore:
Timestamp:
03/22/09 20:58:55 (12 years ago)
Author:
Kon Lovett
Message:

Save. Mvd params into locale.scm

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/3/locale/trunk/locale-categories.scm

    r13852 r13860  
    1414    locale-dictionary-category
    1515    ;
     16    current-locale-dictionary
    1617    locale-category-ref
    1718    set-locale-category!) )
    1819
    19 (require-extension srfi-9 lookup-table locale-components locale-errors)
     20(require-extension srfi-9 miscmacros lookup-table locale-components locale-errors)
    2021
    2122;;
     
    2425  (unless (symbol? obj)
    2526    (type-error loc "symbol" obj) ) )
    26 
    2727
    2828;;;
     
    3636  (%make-locale-dictionary (make-dict)) )
    3737
     38(define (check-locale-dictionary loc obj)
     39  (unless (locale-dictionary? obj)
     40    (type-error loc "locale-dictionary" obj) ) )
    3841;;
    3942
     
    4144  (check-locale-dictionary 'set-locale-dictionary-category! rec)
    4245  (check-symbol 'set-locale-dictionary-category! key)
    43   (if (not val) (dict-delete! (locale-dictionary-table rec) key)
    44       (begin
    45         (check-locale-components 'set-locale-dictionary-category! val)
    46         (dict-set! (locale-dictionary-table rec) key val) ) ) )
     46  (let ((tbl (locale-dictionary-table rec)))
     47    (if (not val) (dict-delete! tbl key)
     48        (begin
     49          (check-locale-components 'set-locale-dictionary-category! val)
     50          (dict-set! tbl key val) ) ) ) )
    4751
    4852;; A locale-component or #f
     
    5761;;
    5862
     63(define-parameter current-locale-dictionary (make-locale-dictionary)
     64  (lambda (obj)
     65    (cond ((locale-dictionary? obj)
     66            obj)
     67          (else
     68            (warning 'current-locale-dictionary (make-type-error-message "locale-dictionary") obj)
     69            (current-locale-dictionary) ) ) ) )
     70
     71;;
     72
    5973(define (set-locale-category! what value)
    6074  (set-locale-dictionary-category! (current-locale-dictionary) what value) )
Note: See TracChangeset for help on using the changeset viewer.