Check-in [f7b95bffe0]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:some cleanup on free-gettext.sls
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: f7b95bffe0fcda8df79a00a14ab560d5385e0133
User & Date: aldo 2016-12-14 00:08:31
Context
2016-12-14
14:46
call/1cc in sxml-match check-in: 179541393e user: aldo tags: trunk
00:08
some cleanup on free-gettext.sls check-in: f7b95bffe0 user: aldo tags: trunk
2016-12-13
23:43
more informative error when not invoking textdomain before gettext check-in: e92cdb8e54 user: aldo tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to free-gettext.sls.

106
107
108
109
110
111
112

113
114
115
116
117
118
119
120
121
122

123
124
125

126
127
128
129
130
131
132
...
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
    (cond
     [(irregex-match (irregex regex) txt)
      => (lambda (m)
	   (map (lambda (x)
		  (irregex-match-substring m x))
		(iota (+ 1 (irregex-match-num-submatches m)))))]
     [else #f]))

  (alias get-environment-variable getenv)
  (alias arithmetic-shift bitwise-arithmetic-shift)
  (alias hash-table-ref/default hashtable-ref)
  (alias hash-table-set! hashtable-set!)
  (alias hashtable-exists? hashtable-contains?)
  
  (define read-byte
    (case-lambda
     [() (get-u8 (current-input-port))]
     [(p) (get-u8 p)]))

  (define read-line (case-lambda
		     [() (get-line (current-input-port))]
		     [(port) (get-line port)]))

  (define (string-null? x) (string=? x ""))
  
  (define (call-with-input-string str proc)
    (with-input-from-string str
      (proc (current-input-port))))
  
  (define (select-transcoder enc)
................................................................................
                               dirs
                               suffixes)))))

  (let ((files (make-file-list))
        (cache (make-cache)))

    (define (search msg . opt)
      (if (and cached? (hashtable-exists? cache msg))
          (hash-table-ref/default cache msg #f)
          (let-optionals* opt ((msg2 #f) (n #f))
            (let ((split? (number? n)))
              (any
               (lambda (gf)
                 (and-let* ((x0 (lookup-message gf msg msg2))
                            (x (if (and split? (eq? (gfile-type gf) 'mo))







>




|

<
<
<
|
>



>







 







|







106
107
108
109
110
111
112
113
114
115
116
117
118
119



120
121
122
123
124
125
126
127
128
129
130
131
132
...
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
    (cond
     [(irregex-match (irregex regex) txt)
      => (lambda (m)
	   (map (lambda (x)
		  (irregex-match-substring m x))
		(iota (+ 1 (irregex-match-num-submatches m)))))]
     [else #f]))
  
  (alias get-environment-variable getenv)
  (alias arithmetic-shift bitwise-arithmetic-shift)
  (alias hash-table-ref/default hashtable-ref)
  (alias hash-table-set! hashtable-set!)
  (alias hash-table-exists? hashtable-contains?)
  



  (define (read-byte p) (get-u8 p))
  
  (define read-line (case-lambda
		     [() (get-line (current-input-port))]
		     [(port) (get-line port)]))

  (define (string-null? x) (string=? x ""))
  
  (define (call-with-input-string str proc)
    (with-input-from-string str
      (proc (current-input-port))))
  
  (define (select-transcoder enc)
................................................................................
                               dirs
                               suffixes)))))

  (let ((files (make-file-list))
        (cache (make-cache)))

    (define (search msg . opt)
      (if (and cached? (hash-table-exists? cache msg))
          (hash-table-ref/default cache msg #f)
          (let-optionals* opt ((msg2 #f) (n #f))
            (let ((split? (number? n)))
              (any
               (lambda (gf)
                 (and-let* ((x0 (lookup-message gf msg msg2))
                            (x (if (and split? (eq? (gfile-type gf) 'mo))