164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
|
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
|
+
-
+
|
(if (string=? head "")
(if (null? tail)
result
(loop (car tail)(cdr tail) result))
(let* ((key (substring head 0 2))
(rem (substring head 2 (string-length head)))
(num (string->number key 16))
(ch (if (and (number? num)
(ch (if (exact? num)
(exact? num))
(integer->char num)
#f)) ;; this is an error. I will probably regret this some day
(chstr (if ch (make-string 1 ch) ""))
(newres (if ch
(string-append result chstr rem)
(string-append result head))))
;; (print "head: " head " num: " num " ch: |" ch "| chstr: " chstr)
|