Random assorted comments follow.
ZHAO Wei <zhaoway@public1.ptt.js.cn> writes:
> (define (make-locker val)
> (list (make-lock) val))
If you simply want to create a structure that associates two values, a
pair would suffice: (cons (make-lock) val)
> (define (iconv str)
> (let ((ret (run/string (| (begin (display-line str))
> (iconv -f gb2312 -t utf8)))))
Input to a process can be directed from the printed representation of
a Scheme object, such as a string, allowing the following
simplification (omitting the newline):
(run/string (iconv -f gb2312 -t utf8) (<< 0 ,str))
> (substring ret 0 (- (string-length ret) 1))))
Using string-drop-right from list-lib (SRFI-13), the equivalent can be
expressed a little simpler:
(string-drop-right ret 1)
|