Changeset 35494 in project


Ignore:
Timestamp:
04/30/18 03:33:24 (4 months ago)
Author:
kon
Message:

re-flow

File:
1 edited

Legend:

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

    r35493 r35494  
    5959    first second third
    6060    map! reverse! every drop-right!
    61     remove remove! fold list-copy)
     61    remove remove! list-copy)
    6262  (only srfi-13
    6363    string-downcase)
     
    194194    (else               (->symbol obj) ) ) )
    195195
    196 (define (cons-locale-item lci lst)
    197   (if lci
    198     (cons (symbol->string lci) lst)
    199     lst ) )
    200 
    201196;; Canonical current locale
    202197
     
    231226;;
    232227
    233 (define (bundle-specification-directory bndl-spec)
    234   (reverse! (fold cons-locale-item '() (cdr bndl-spec))) )
    235 
    236 (define (bundle-specification-filename bndl-spec) (symbol->string (car bndl-spec)))
     228(define (bundle-specification-directory-path bndl-spec)
     229  (define (add-item ls lci)
     230    (if lci
     231      (cons (symbol->string lci) ls)
     232      ls ) )
     233  (reverse! (foldl add-item '() (cdr bndl-spec))) )
     234
     235(define (bundle-specification-filename bndl-spec)
     236  (symbol->string (car bndl-spec)) )
    237237
    238238(define (bundle-specification->pathname bndl-spec)
    239239  (make-pathname
    240     (bundle-specification-directory bndl-spec)
     240    (bundle-specification-directory-path bndl-spec)
    241241    (bundle-specification-filename bndl-spec)) )
    242242
     
    246246(define (need-bundle-absolute-pathname loc bndl-spec alt-dir)
    247247  (bundle-specification->absolute-pathname
    248     (check-bundle-specifier loc bndl-spec) alt-dir) )
     248    (check-bundle-specifier loc bndl-spec)
     249    alt-dir) )
    249250
    250251;; Bundles Dictionary
     
    326327(define-warning-parameter current-locale-format-function format procedure)
    327328
    328 ;; The default language, country, and locale-details
    329 
    330329(define ((make-locale-loadtime-guard chk) x)
    331   (let ((x (chk x)))
     330  (let (
     331    (x (chk x)) )
    332332    (unless *LOADTIME* (invalidate-package-bundle-cache))
    333333    x ) )
     334
     335;; The default language, country, and locale-details
    334336
    335337(define-parameter current-language (locale-ref 'language)
     
    360362
    361363(define (localized-template pkgnam tplnam #!optional defpkg deftpl)
    362   (let ((bundle (cached-package-bundle pkgnam)))
     364  (let (
     365    (bundle (cached-package-bundle pkgnam)) )
    363366    (if bundle
    364367      (dict-ref bundle tplnam deftpl)
     
    431434
    432435(define (localized-template-set! pkgnam tplnam value)
    433   (and-let* ((bndl (cached-package-bundle pkgnam)))
     436  (and-let* (
     437    (bndl (cached-package-bundle pkgnam)) )
    434438    (dict-set! bndl tplnam value)
    435439    #t ) )
     
    457461;Assumes valid argument!
    458462(define (required-global-ref loc ident)
    459   (let ((ident (make-identifier ident)))
     463  (let (
     464    (ident (make-identifier ident)) )
    460465    (if (and ident (%global-bound? ident))
    461466      (%global-ref ident)
     
    475480
    476481(define (check-template-variable-name loc pkgnam obj #!optional argnam)
    477   (check-symbol loc obj argnam)
    478   (check-template-identifier-name loc (required-localized-template pkgnam obj) argnam)
     482  (check-template-identifier-name
     483    loc
     484    (required-localized-template pkgnam (check-symbol loc obj argnam))
     485    argnam)
    479486  obj )
    480487
    481488(define (check-template-variable-names loc pkgnam obj #!optional argnam)
    482   (check-list loc obj argnam)
    483   (for-each (cut check-template-variable-name loc pkgnam <> argnam) obj)
     489  (for-each
     490    (cut check-template-variable-name loc pkgnam <> argnam)
     491    (check-list loc obj argnam))
    484492  obj )
    485493
     
    503511
    504512; A `library-name' is a pathname or unitname.
    505 (define +loaded-library-names+ '())
     513(define *loaded-library-names* '())
    506514
    507515(define (*load-code loc libspec)
     
    514522      (and (string? (if (pair? libspec) (second libspec) libspec)) libspec) ) )
    515523    ;pathname is preferred to a unitname
    516     (let ((the-name (or path unit)))
    517       (unless (member the-name +loaded-library-names+)
     524    (let (
     525      (pn (or path unit)) )
     526      (unless (member pn *loaded-library-names*)
    518527        (cond
    519528          ;Library Unit w/ path
     
    529538          (else
    530539            (error loc "invalid library load specificiation" libspec) ) )
    531         (set! +loaded-library-names+ (cons the-name +loaded-library-names+)) ) ) ) )
     540        (set! *loaded-library-names* (cons pn *loaded-library-names*)) ) ) ) )
    532541
    533542(define (fixup-references loc pkgnam var-tplnams)
     
    567576
    568577(define (load-bundle! bndl-spec . args)
    569   (let-optionals args ((alt-dir (system-bundle-directory)))
     578  (let-optionals args (
     579    (alt-dir (system-bundle-directory)) )
    570580    (let (
    571581      (path
     
    578588
    579589(define (store-bundle! bndl-spec . args)
    580   (let-optionals args ((alt-dir (system-bundle-directory)))
     590  (let-optionals args (
     591    (alt-dir (system-bundle-directory)) )
    581592    (let (
    582593      (path
     
    592603
    593604(define (remove-bundle! bndl-spec . args)
    594   (let-optionals args ((alt-dir (system-bundle-directory)))
     605  (let-optionals args (
     606    (alt-dir (system-bundle-directory)) )
    595607    (let (
    596608      (path
     
    603615
    604616(define (remove-bundle-directory! bndl-spec . args)
    605   (let-optionals args ((alt-dir (system-bundle-directory)))
     617  (let-optionals args (
     618    (alt-dir (system-bundle-directory)) )
    606619    (let (
    607620      (path
     
    624637(define (load-best-available-bundle! bndl-spec . args)
    625638  (let-optionals args ((alt-dir (system-bundle-directory)))
    626     (let loop ((bndl-spec
    627                 (check-bundle-specifier 'load-best-available-bundle! bndl-spec)))
     639    (let loop (
     640      (bndl-spec
     641        (check-bundle-specifier 'load-best-available-bundle! bndl-spec)))
    628642      (and
    629643        (not (null? bndl-spec))
Note: See TracChangeset for help on using the changeset viewer.